HttpRequestSend

function

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

Declaration
define function HttpRequestSend
            modifiable  HttpRequest Request
   into  modifiable   HttpResponse  Response
   timeout  value       integer Timeout optional initial {10000}

Argument definitions

Request
is an HTTP request object.
Response
is the HTTP response object.
Timeout
is the maximum number of milliseconds to wait for a communication operation before failing.


Purpose

Use HttpRequestSend to construct an HTTP message from an HTTP request object and send it from the client to the server. HttpRequestSend then waits for the server response that is then used to populate the HTTP response object argument.

Requirements

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

  include "omhttp.xin"

Usage Notes

Request is set to an error state if the TCP connection times out.

Response's object values are reset to their default values before being updated by the transaction.

Example


    ; HttpRequestSend
    include "omhttp.xin"
  
    process
  
       local HttpRequest my-Request
       local HttpResponse get-Response
  
       HttpRequestSetFromUrl my-Request
          from "http://www.omnimark.com/home/home.html"
  
       HttpRequestSend my-Request into get-Response timeout 60000
  
       output get-Response{"entity-body"}