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

HttpObjectGetHeaders

 
 

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

Declaration

define function HttpObjectGetHeaders
            read-only   stream   HttpObject
   into     modifiable  stream   Headers

Argument definitions

HttpObject
is an HTTP request or HTTP response object (input argument).
Headers
is a returned shelf containing the headers as keyed items. The contents of the shelf are cleared before the headers are copied to it. The item key is the header name (output argument)


Purpose

Use HttpObjectGetHeaders to get the names and values of all headers defined for the HTTP request or response object. The values are returned as keyed items in a stream shelf.

Requirements

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


  include "omhttp.xin"

Usage Notes

HttpObjectGetHeaders is usually called in a server program.

Example

This code outputs all headers and their corresponding keys.

  ; HttpObjectGetHeaders
  include "omhttp.xin"
  
  process
     local HttpRequest my-Request
     local HttpResponse my-Response
     local stream request-Headers variable
     local stream response-Headers variable
  
     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
   HttpObjectSetHeader
 
  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 ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.