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 |
| url | string | | Optional.
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
protocol://[username:pwd@]server[:port]//path |
| protocol | string | | Optional, default = HTTP
Currently 'HTTP' or 'HTTPS' (case insensitive)
|
| host | string | | Optional.
IP address or DNS name of server. Required if 'url' not specified.
|
| port | number | | Optional, default = 80
IP port number.
|
| path | string | | Required.
Virtual path name of the resource to access.
|
| method | string | | Optional, default = GET
"GET", "POST" etc.
|
| proxy | string | | Optional.
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.
|
| 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.
|
| postdata | string | | Required.
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.
|
| res | number | | Optional.
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.
|
| responseHeaders | struct HttpRequest.HttpHeader | see definition | Optional.
Set of HTTP headers in the response.
|
| body | string | | Optional.
After a successful request to a remote sever this property will contain the body of the HTTP response.
|
| binary | string | | Optional.
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.
|
| timeout | number | | Optional.
How long to wait before a request 'times out'.
|
| elapsed | number | | Optional.
Defined by HttpRequest after a successful doRequest() call. Contains the time in milli-seconds
taken to service the request.
|
| 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.
|