Indy 9
TIdHTTPResponse
Hierarchy, Properties, Methods, See Also, Unit: IdHTTP
Provides access to headers and properties for an HTTP response.
TIdHTTPResponse = class(TIdResponseHeaderInfo)
Unit
IdHTTP
Description
TIdHTTPResponse is a TIdResponseHeaderInfo descendant that provides properties and methods used to define and manipulate header values used in an HTTP response.

TIdHTTPResponse is the type used to represent the TIdHTTP.Response property, and is used in when TIdHTTP receives a response to an HTTP request, and indicates both the numeric and textual responses from the host server, and the connection headers for the HTTP response.

A TIdHTTPResponse instance is provided as an argument to TIdHTTP event handlers that use or update valued in the HTTP response, including OnRedirect, OnSelectAuthorization, OnSelectProxyAuthorization, OnAuthorization, OnProxyAuthorization.

TIdHTTPResponse is also the type used to represent the TIdHTTPProtocol.Response property, and allows the protocol handler to store a reference to the response received in HTTP protocol exchanges.


TIdHTTPResponse.ContentStream
TIdHTTPResponse
Contains the streamed content for the HTTP response.
property ContentStream: TStream;
Description
ContentStream is a TStream property that represents the stream used when TIdHTTP.ReadResult is used to read the response content for an HTTP Get or Post request. When specified, the size of ContentStream should match the ContentLength for the response. Otherwise, response content is read until the connection is closed. ContentStream may also be used to retrieve "chunked" response content when the transfer encoding for the response indicates that "chunked" retrieval is supported.

TIdHTTPResponse.KeepAlive
TIdHTTPResponse
Indicates if the client connection should be maintained during request/ response protocol exchanges.
property KeepAlive: Boolean;
Description
KeepAlive is a Boolean property that indicates if the HTTP response supports and uses the HTTP Keep-Alive header for connection control. Reading the value in KeepAlive causes the value in ResponseText to be examined for a valid HTTP protocol version.

For HTTP 1.1 clients, the value for KeepAlive will contain True if the HTTP client connection is still intact, and Connetion and ProxyConnection header values do not contain the 'CLOSE' directive.

For HTTP 1.0 clients, the value for KeepAlive will contain False unless the HTTP Keep-Alive header is used for the HTTP Connection or ProxyConnection.


TIdHTTPResponse.ResponseCode
TIdHTTPResponse
Indicates the numeric response code in an HTTP response.
property ResponseCode: Integer;
Description
ResponseCode is an Integer property that represents the numeric HTTP response code received in the HTTP response message. Reading the value in ResponseCode cause the numeric return value to be extracted from the textual value in ResponseText.

ResponseCode is updates when a request is executed using TIdHTTP.FoRequest, and when TIdHTTPProtocol.ProcessResponse is used to examine result values for state-dependencies during HTTP protocol exchanges.


TIdHTTPResponse.ResponseText
TIdHTTPResponse
Represents the textual messages received in an HTTP response.
property ResponseText: string;
Description
ResponseText is a String property that represents the textual values retrieved in an HTTP reponse, and contains the numeric response code and associated message string. ResponseText is used to extract the numeric HTTP response code in ResponseCode.

ResponseText is updated in TIdHTTP.ConnectToHost and TIdHTTP.DoRequest, when the HTTP client established a connection to the host server, or receives an HTTP response from the server.


TIdHTTPResponse.ResponseVersion
TIdHTTPResponse
HHTP version used and supported in the HTTP response.
property ResponseVersion: TIdHTTPProtocolVersion;
Description
ResponseVersion is a TIdHTTPProtocolVersion property that represents the HTTP protocol version supported in a response received from an HTTP server. ResponseVersion is used to help determine the value used in the KeepAlive property.

TIdHTTPResponse.Create
TIdHTTPResponse
Constructor for the object instance.
constructor Create(AParent: TIdCustomHTTP); virtual; reintroduce;
Parameters
AParent: TIdCustomHTTP
HTTP Client that owns the response.
Description
Create is the constructor for the object instance. Create calls the inherited Create method, and assign AParent to the private member that represents the owner of the HTTP response.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.