HeaderValue (HttpResponse function)

From m204wiki
Revision as of 05:59, 19 June 2011 by Goff (talk | contribs) (match syntax table to syntax template; edits, tags and links)
Jump to navigation Jump to search

HTTP response header value (HttpResponse class)

The HeaderValue method helps you retrieve the HTTP response headers returned by an HTTP request. HeaderValue returns the value of the header whose name you specify, and it can optionally return the value of a particular occurrence of a header.

Syntax

%string = httpResponse:HeaderValue( name, [occurrence])

Syntax terms

%sting A string or longstring variable for the assignment of the header value (or a zero-length string, if the requested header is not present).
httpResponse A reference to an HttpResponse object that was returned by a Get, post, or Send method of an HttpRequest object.
name A string expression that yields the name of an HTTP response header. If name is not present, HeaderValue returns a zero-length string.
occurrence Identifies a particular occurrence of header name. It is a numeric expression that must evaluate to an integer from 1 through the number of occurrences of the header. The number of occurrences is available from HeaderCount(name).

If you specify a non-positive or non-numeric value, the request is cancelled. If occurence is not explicitly specified, its default is 1.

See also