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 |
effectiveURL | string | | Optional.
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)
|
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.
|
redirectCount | number | | Optional.
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.
|
postdata | string | | Required.
The textual data to send as post-data to the server.
|
headers | array of struct 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.
|
errorMessage | string | | Required.
Any error message returned as part of the request.
|
responseHeaders | struct 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.
|
httpVersion | string | | Optional.
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.
|
sslVersion | string | | Optional.
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.
- default
- SSLv2
- SSLv3
- TLSv1.x
- TLSv1.0
- TLSv1.1
- TLSv1.2
|
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.
|