GetHeader Method  
 

Returns the value of an HTTP header from the server response.

Syntax

object.GetHeader( HeaderName, HeaderValue )

Parameters

HeaderName
A String value which specifies the name of the HTTP response header. The header names are not case-sensitive. Header names may only contain ASCII letters, numbers and a restricted subset of punctuation characters. Header names cannot contain Unicode or ANSI multi-byte character sequences.
HeaderValue
A String passed by reference which will contain the value of the header when the method returns. This parameter is required.

Return Value

A value of True is returned if the method completed successfully. If the method fails, it will return False and the LastError property will contain the error code.

Remarks

The GetHeader method returns the value of a response header from the last request made to the service provider.

This method is intended for applications that need lower-level access to provider-specific response headers. Most applications do not need to call this method. Standard response information, such as the HTTP status code, response text, token usage, model name, and elapsed time, is available through the control's properties.

The headers returned by a service provider can vary depending on the provider, model, endpoint, account configuration, and the specific request being made. Applications should not assume that a particular header will always be present unless it is documented by the service provider.

If no response headers are available, or if the specified header was not returned by the server, the HeaderValue parameter will contain an empty string when the method returns.

See Also

HttpStatus Property, Options Property, UserAgent Property, ClearHeaders Method, SendMessage Method, SetHeader Method