HTTP

External objects

Properties

Property Description
$accept A single column list, where each line is a media type that is acceptable for the response e.g. text/xml; if empty, defaults to text/plain
$actualurl After a successful call to $dohttpmethod(), this contains the actual URL of the data that was loaded (this may be different to $url if a redirect occurred)
$connectretries The number of times $dohttpmethod() attempts to connect to a host; only relevant for multihomed hosts (defaults to 5)
$connecttimeout The number of seconds within which an Internet connection must be established by $dohttpmethod(); if a connection is not established in this time, $dohttpmethod() fails (defaults to 60)
$disablecookies If true, automatic cookie processing is disabled (defaults to false)
$disablekeepalive If true, keep-alive semantics are disabled for the connection (defaults to false)
$disableredirects If true, automatic redirection is disabled (defaults to false)
$escapedisable If true, unsafe characters in the object name part of the URL are not converted to escape sequences (defaults to false)
$escapedisablequery If true, unsafe characters in the query component of the URL are not converted to escape sequences (defaults to false)
$escapepercent If true, unsafe characters (including the percent symbol) in the object name part of the URL are converted to an escape sequence. If false,the percent symbol is not converted to an escape sequence (defaults to false)
$extraheaders A two column list, where each line is an HTTP header to be sent with the request. Column 1 is the header name, and column 2 the header value. If the object normally generates a header specified in the list,the list value overrides it
$httperrorcode If $dohttpmethod() fails, this contains a non-zero error code
$httperrortext If $dohttpmethod() fails, this contains text describing the error
$httpversion One of the kWebHttpVersion... constants (default to HTTP/1.1)
kWebHttpVersion10 kWebHttpVersion11
$nullcodepage If true, the object name part of the URL is assumed to consist of valid ANSI characters. No checks are done for unsafe characters (defaults to false)
$proxy One of the kWebProxy... constants that indicates if a proxy server is to be used (defaults to kWebProxyDefault)
kWebProxyDefault kWebProxyNamed kWebProxyNone
$proxybypasslist A string,containing semi-colon separated server names that are accessed directly when using $proxyname;server names can include * as a wildcard e.g. *.omnis.net; the name <local> bypasses host names that do not contain a period
$proxyname The name of the CERN type proxy server used when $proxy is set to kWebProxyNamed
$receivetimeout The number of seconds within which a response must be received from the server by $dohttpmethod(); if the response is not received within this time, $dohttpmethod() fails (defaults to 30)
$refresh If true, the request is forwarded to the originating server rather than retrieving a cached version of a resource from a proxy server (defaults to false)
$responsecharset If $responsecontenttype is text/..., the charset of the data received
$responsecontenttype The content type of the response received from the server
$securityallowcertcninvalid If true, allows an invalid common name in a certificate; that is, the server name specified by the application need not match the common name in the certificate (secure connections only) (defaults to false)
$securityallowcertdateinvalid If true, allows an invalid certificate date, that is, an expired or not-yet-effective certificate (secure connections only) (defaults to false)
$securityallowunknownca If true, allows an invalid certificate authority (secure connections only) (defaults to false)
$securityignorewrongcertusage If true, allows the identity of a server to be established with a non-server certificate (for example, a client certificate). (secure connections only) (defaults to false)
$sendcharset If $sendcontenttype is text/..., the charset of the data to be sent; if the contenttosend parameter of $dohttpmethod() is a character variable,the object will convert the data appropriately if $sendcharset is iso-8859-1 or utf-8
$sendcontenttype The content type of the data to be sent to the server, e.g. text/plain
$sendtimeout The number of seconds within which the request must be sent to the server by $dohttpmethod(); if the request is not sent within this time, $dohttpmethod() fails (defaults to 30)
$url The URL of the data (prefixed with https:// to use secure HTTP); the url can include parameters, which you can escape using the CGIEncode command (e.g. '=' in a parameter name or value must be encoded as '%3D')

Methods

$callback $callback() called regularly during $dohttpmethod(),to allow the user interface to be updated (you must override this method to do that); returns a Boolean, which is kTrue if $dohttpmethod() is to be cancelled
$dohttpmethod $dohttpmethod(method [,contenttosend]) sends the HTTP method and contenttosend to the object's url, and receives the response from the server; returns a Boolean which is kTrue for success
$getbinaryresponse $getbinaryresponse() returns the response as binary data, exactly as it was received by a successful call to $dohttpmethod()
$getcharacterresponse $getcharacterresponse() returns character data (converting it if necessary and possible) received as a result of a successful call to $dohttpmethod(); returns #NULL if the data cannot be converted
$geterrorcodename $geterrorcodename(code) returns the name of the error code constant for the supplied code