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

HttpResponseOutput

 
 

Library: Net, 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 ] [ LEGACYLIBRARIES ] [ ERRORS ]

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

Copyright © Stilo Corporation, 1988-2005.