Indy 9
|
TIdRequestHeaderInfo = class(TIdEntityHeaderInfo)
The request headers allow the client to pass additional information about the request, or the request client, to the server.
property Accept: string;
Accept is composed of the media type, subtype, and optional parameters. The asterisk "*" character is used to group media types into ranges, with "*/*" indicating all media types and "type/*" indicating all subtypes of that type.
Each media type and subtype may include one or more parameters, beginning with the "q" parameter that indicates the relative quality factor. Quality factors allow the user agent to determine the relative degree of preference for that media type and subtype, using the qvalue scale from 0 to 1. The default value is q=1.
Accept is updated in the ProcessHeaders method. Accept is used in SetHeaders to read the header values for the request.
The default value for Accept is set to 'text/html, */*' when the Clear method is called.
property AcceptCharSet: string;
Each charset value may have an associated quality value which represents the user's preference for that charset. The default value is q=1. For example:
iso-8859-5, unicode-1-1; q=0.8
The special value "*" in Accept-CharSet matches every character set including ISO-8859-1. If no "*" is present in AcceptCharSet, then all character sets not explicitly mentioned get a quality value of 0, except for ISO-8859-1, which gets a quality value of 1 if not explicitly mentioned.
If no AcceptCharSet header is present, the default is that any character set is acceptable.
property AcceptEncoding: string;
property AcceptLanguage: string;
Each language specified may have an associated quality value which represents an estimate of the user preference for the languages specified by that range. The quality value defaults to "q=1". For example:
da, en-gb;q=0.8, en;q=0.7
The special character "*" matches every tag not matched by any other language specifier in AcceptLanguage. If no AcceptLanguage header is present in the request, the server assumes that all languages are equally acceptable.
property BasicAuthentication: boolean;
property From: string;
webmaster@w3.org
From may be used for server logging and as a means for identifying the source of invalid or unwanted requests. From should not be used as an insecure form of access protection.
property Host: string;
When Host does not contain a trailing port number, it is implied that the default TIdHTTP.Port number will be used for the service requested. For example, a request to the origin server for http://www.w3.org/pub/WWW/ could include the following value in Host:
Host: www.w3.org:80
A value must be included in Host for all HTTP/1.1 request messages. If the requested URI in TIdHTTP.URL does not include an Internet host name for the service being requested, then the Host property for the request must be given with an empty value.
The most common form of Request-URI is that used to identify a resource on an origin server or gateway using a relative path specifier. In this case the path in TIdHTTP.URL would contain the absolute path, and the Host property for the request must include the network location or server identity. For example, a client wishing to retrieve the resource identitifed using the path 'www.w3.org/pub/WWW/TheProject.html' would result in a request containg the following:
IdHTTP.URL.URI contains '/pub/WWW/TheProject.html'; IdHTTP.Request.Host contains 'www.w3.org';
Host is updated when TIdHTTP prepares the HTTP request for transmission to the remote server.
property Password: String;
property ProxyConnection: string;
property Referer: string;
If the Referer value is a relative URI, it should be interpreted relative to the URI for the RequestI, and may not include a fragment.
property UserAgent: string;
UserAgent can contain multiple product identifiers and comments identifying the agent and any subproducts which form a significant part of the user agent.
UserAgent should be provided for all HTTP requests.
UserAgent will be reset to its default value in the Clear method.
property Username: String;
procedure Clear; override;
Clear also resets any values in ProxyParams, when the object property has been assigned, prior to calling the inherited Clear method.
procedure ProcessHeaders; override;
ProcessHeaders callls the inherited ProcessHeaders method to allow handing of Entity headers, and headers that are stored in ExtraHeaders.
procedure SetHeaders; override;
SetHeaders also constructs the 'Range' header using the values in ContentRangeStart and ContentRangeEnd. If Authentication has been assigned, or BasicAuthentication is True, SetHeaders will construct an 'Authorization' header using the credentials returned by the TIdAuthentication object instance.
SetHeaders also calls ProxyParams.SetHeaders to allow construction of Proxy-specific header names and values.