TChilkatHttpResponse Delphi Reference
TChilkatHttpResponse
Represents a complete HTTP response.
Object Creation
var
obj: IChilkatHttpResponse;
...
begin
// This object is never created outright.
// It is returned by various TChilkatHttp methods.
obj := httpObject.someMethod(...);
Properties
property Body: OleVariant readonly
The response body returned as a byte array.
property BodyStr: WideString readonly
The response body returned as a string.
property Charset: WideString readonly
The response charset, such as "iso-8859-1", if applicable. Obviously, responses for GIF and JPG files will not have a charset.
property ContentLength: Integer readonly
The content length of the response, in bytes.
property Date: TDateTime readonly
The Date response header field, returned in an easy-to-use date/time data type.
property Domain: WideString readonly
The domain of the HTTP server that created this response.
property Header: WideString readonly
The full text of the response header.
property NumCookies: Integer readonly
The number of cookies included in the response.
property NumHeaderFields: Integer readonly
The number of response header fields.
property StatusCode: Integer readonly
The status code (as an integer) from the first line of an HTTP response. If the StatusLine = "HTTP/1.0 200 OK", the response status code returned is 200.
property StatusLine: WideString readonly
The first line of an HTTP response, such as "HTTP/1.0 200 OK".
Methods
function GetCookieDomain(index: Integer): WideString;
Returns the domain of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property. Returns a null on failure
function GetCookieExpires(index: Integer): TDateTime;
Returns the expiration date/time of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.
function GetCookieExpiresStr(index: Integer): WideString;
Returns the expiration date/time of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property. Returns a null on failure
function GetCookieName(index: Integer): WideString;
Returns the name of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property. Returns a null on failure
function GetCookiePath(index: Integer): WideString;
Returns the path of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property. Returns a null on failure
function GetCookieValue(index: Integer): WideString;
Returns the value of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property. Returns a null on failure
function GetHeaderField(name: WideString): WideString;
Returns the value of a response header field accessed by field name. Returns a null on failure
function GetHeaderFieldAttr(name: WideString, attrName: WideString): WideString;
Returns a response header field attribute. As an example, the response charset is simply the GetHeaderFieldAttr("content-type","charset") Returns a null on failure
function GetHeaderName(index: Integer): WideString;
Gets the name of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property. Returns a null on failure
function GetHeaderValue(index: Integer): WideString;
Gets the value of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property. Returns a null on failure
function Serialize(): WideString;
Serializes the HttpResponse object to a string. Returns a null on failure
procedure Unserialize(str: WideString);
Restores the state of an HttpResponse object from a serialized HttpResponse.
|