swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

HttpObjectSetHeader

 
 

Library: Net, HTTP support (OMHTTP)
Include: omhttp.xin

Declaration

  define function HttpObjectSetHeader
                 modifiable  stream   HttpObject
     for         value       stream   HeaderName
     to          value       stream   HeaderValue
     append      value       switch   AppendMode  optional initial {true}

Argument definitions

HttpObject
is an HTTP request or HTTP response object (input argument).
HeaderName
is the name of the header (input argument).
HeaderValue
is the value to assign to the header (input argument).
AppendMode
is an optional argument that specifies whether the value should be appended to any existing value. Header values are appended by default (input argument).


Purpose

Use HttpObjectSetHeader to set a named header value in an HTTP request or response object.

Requirements

You must include the following line at the beginning of your OmniMark program:


  include "omhttp.xin"

Usage Notes

HttpObjectSetHeader can be called from either a client or a server program.

Example

Set a request and a response header and then retrieve them.


  ; HttpObjectSetHeader
  include "omhttp.xin"

  process

     local HttpRequest my-Request
     local HttpResponse my-Response

     local stream request-Headers variable
     local stream response-Headers variable

     HttpObjectSetHeader my-Request for "User-Agent" to "omHTTP"
     HttpObjectSetHeader my-Response for "Accept" to "*/*"

     HttpObjectGetHeaders my-Request into request-Headers
     HttpObjectGetHeaders my-Response into response-Headers

     output "Request headers:%n"
     repeat over request-Headers
        output key of request-Headers || "=%g(request-Headers)%n"
     again
     output "Response headers:%n"
     repeat over response-Headers
        output key of response-Headers || "=%g(response-Headers)%n"
     again

    Related Syntax
   HttpObjectGetHeaders
 
  Other Library Functions
   HttpConnectionSendResponse
   HttpLibraryVersion
   HttpObjectGetCookieAttributes
   HttpObjectGetCookieValues
   HttpObjectGetHeaders
   HttpObjectGetStatusReport
   HttpObjectIsInError
   HttpObjectSetCookieAttribute
   HttpObjectSetCookieValue
   HttpObjectSetHeader
   HttpRequest
   HttpRequestGetSearchItems
   HttpRequestSend
   HttpRequestSetFromUrl
   HttpRequestSetProxy
   HttpRequestSetSearchItem
   HttpResponse
   HttpResponseOutput
   HttpServiceAwaitRequest
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:18 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.