|
|
|
|
built-in variable
|
HttpRequest
|
|
Purpose
The HttpRequest object is a keyed shelf that contains information that can be sent to an HTTP server.
Usage Notes
You create the HttpRequest shelf by using HttpRequestSetFromUrl
. A call to this function will create the necessary items for most uses. To use httpRequest components in your program, you must also include the following include statement in your program:
include "omhttp.xin"
p>The HTTP request object is a keyed shelf used to create an HTTP-formatted request message, which can then be sent to an HTTP server. Most simple requests can be created using HttpRequestSetFromUrl
, which will create sufficient items in the HTTP request shelf to cover most circumstances. The HTTP request shelf contains the following keyed items:
- "last-error" -- a string describing any errors encountered during the last function call. If no errors were detected, it is a zero-length string.
- "host" -- the IP address of the host. This value must be a valid IP address.
- "port" -- the HTTP server port number. This must be a string representation of a valid port number. The default value is "80".
- "proxy-host" -- the IP address of the proxy host. This value must be a valid IP address.
- "proxy-port" -- the HTTP proxy server port number. This must be a string representation of a valid port number. The default value is "80".
- "method" -- the HTTP request method. The default value is "GET".
- "path" -- the path and filename of the resource on the HTTP server to access. The path must begin with the "/" character, which is the default value.
- "http-version" -- the version of HTTP used to format the message. The default value is "HTTP/1.0".
- "cookie-version" -- the version of cookie support. The default value is "1".
- "entity-body" -- additional information to send to the server. The default value is a zero-length string.
Related omhttp - HTTP support library functions:
The functions
- HttpRequestSend
- HttpRequestGetSearchItems
- HttpRequestSetFromUrl
- HttpRequestSetProxy
- HttpRequestSetSearchItem
Example
Within your program, you can create as many instances of the httpRequest OMX component as you require by declaring global and local variables of type "httpRequest".
; HttpRequestSend
local HttpRequest my-Request
local HttpResponse get-Response
HttpRequestSetFromUrl my-Request
from "http://www.omnimark.com/whats-new.html"
HttpRequestSend my-Request into get-Response timeout 60000
output get-Response{"entity-body"}
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.