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

HttpResponseOutput

 
 

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

Declaration

define function HttpResponseOutput
     modifiable stream Response

Argument definitions

Response
is the HTTP response to be sent.


Purpose

Use HttpResponseOutput to format the contents of a response object as a valid HTTP-formatted message and write it to the current output.

Requirements

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

  include "omhttp.xin"

Usage Notes

This function is generally located in a server program and is used by the HttpConnectionSendResponse function.

Example


  include "omtcp.xin"
  include "omhttpsv.xin"
  
  define function ReturnHttpResponse
     (value       TCPConnection  connection,
      read-only   stream         response-body)
  as
     ; local variables
     local HttpResponse response
     local stream       write-to-client
  
     ; set the message body
     open response{'entity-body'} as buffer
     using output as response{'entity-body'}
     do
        output '<html><head><title>HttpResponseOutput Example</title></head><body>'
        output response-body
        output '</body></html>'
     done
     close response{'entity-body'}
  
     ; send response over the provided TCP connection
     open write-to-client as TCPConnectionGetOutput connection timeout 10000
     using output as write-to-client
       HttpResponseOutput Response
     close write-to-client

    Related Syntax
   HttpConnectionSendResponse
 
  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.