This functionality allows applications to access the wealth of online resources available on the Internet,
Intranet or Extranet. Examples of where this functionality has been used include:
The HttpRequest class is a fairly simple basic access class that allows raw HTTP requests to be made across a network.
Using this class you can build more sophisticated classes to encapsulate higher level functionality such as SOAP access.
|Name ||Type/Value ||Range/Length ||Description |
Specify the target URL that you wish to retrieve. If you use the
'URL' parameter the 'protocol', 'host', 'port' and 'path' attributes are
ignored. Format is
After a successful call to doRequest this property will contain the actual URL retrieved. If the original URL caused a redirect then this
will reference the final URL server to the client (subject to maxRedirects being large enough).
|protocol||string|| ||Optional, default = HTTP|
Currently 'HTTP' or 'HTTPS' (case insensitive)
IP address or DNS name of server. Required if 'url' not specified.
|port||number|| ||Optional, default = 80|
IP port number.
Virtual path name of the resource to access.
|method||string|| ||Optional, default = GET|
"GET", "POST" etc.
Address (name/ip address:port) of an intermediate proxy device.
|proxyType||string|| ||Optional, default = http|
String identifying the type of the optional proxy. Ignored unless 'proxy' is defined. May be
'http', 'socks4', 'socks4a' or 'socks5' (case insensitive)
|maxRedirects||number|| ||Optional, default = 0|
By default HttpRequest makes a single request - returning everything to the caller. If you set
'maxRedirects' to a number greater than zero, Whitebeam will automatically follow redirect
headers fom the origin server.
After a request has been made this property will hold the number of redirects followed to reach the effectiveURL|
|autoRefer||bool|| ||Optional, default = true|
If 'maxRedirects' is greater than zero, when Whitebeam follows a redirect it automatically sets the referer header to the previous URL.
The textual data to send as post-data to the server.
|headers||array of struct HttpRequest.HttpHeaders||see definition ||Required.
Set of headers to send to the server.
This property will not exist until an HTTP request is made. Subsequently the property
will hold either the HTTP response code returned from the remote server or the
value -1 - indicating the server could not be contacted.
Any error message returned as part of the request.
|responseHeaders||struct HttpRequest.HttpHeader||see definition ||Optional.
Set of HTTP headers in the response.
After a successful request to a remote sever this property will contain the body of the HTTP response.
If set to 'true' then the 'body' field will be a binary object containing the raw data
returned in the request. This is useful in those cases where, for example, the HTTP request
is to retieve binary data such as image.
How long to wait before a request 'times out'.
Defined by HttpRequest after a successful doRequest() call. Contains the time in milli-seconds
taken to service the request.
Specify the version of the HTTP protocol to use. These values are defined by the Curl library linked with Whitebeam. The following strings are allowed, however some may be rejected
if the protocol is not supported by the underlying libcurl library.
Specify the version of the HTTPS SSL protocol to be used for this request. The following strings are allowed, however some may be rejected
if the protocol is not supported by the underlying libcurl library/openSSL library to which Whitebeam is linked.
|sslVerifyPeer||bool|| ||Optional, default = false|
If set to 'true' and the protocol is HTTPS - Whitebeam checks the authenticity of the origin servers certificate before
completing the request. If the certificate is invaid the request aborts.
|sslVerifyHost||bool|| ||Optional, default = false|
Implies sslVerifyPeer==true. Once the certificate has been validated, also ensure that it applies to the origin server.