HeaderValue (HttpResponse function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:HttpResponse:HeaderValue subtitle}}
{{Template:HttpResponse:HeaderValue subtitle}}
The <var>HeaderValue</var> method helps you retrieve the HTTP response headers returned by an HTTP request.  <var>HeaderValue</var> returns the value of the header whose name you specify, and it can optionally return the value of a particular occurrence of a header.


This 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==
==Syntax==
{{Template:HttpResponse:HeaderValue syntax}}
{{Template:HttpResponse:HeaderValue syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%st</th>
<tr><th>%string</th>
<td>A string or longstring variable for the assignment of the header value (or a zero-length string, if the requested header is not present).
<td>A string or <var>[[Longstrings|longstring]]</var> variable for the assignment of the header value (or a zero-length string, if the requested header is not present).</td></tr>
</td></tr>
<tr><th>httpResponse</th>
<tr><th>%httpresp</th>
<td>A reference to an <var>[[HttpResponse_class|HttpResponse]]</var> object that was returned by a <var>[[Get_(HttpRequest_function)|Get]]</var>, <var>[[Post_(HttpRequest_function)|Post]]</var>, or <var>[[Send_(HttpRequest_function)|Send]]</var> method of an <var>[[HttpRequest_class|HttpRequest]]</var> object.</td></tr>
<td>A reference to an HTTPResponse object that was returned by a Get, Post, or Send method of an HTTPRequest object.
</td></tr>
<tr><th>name</th>
<tr><th>name</th>
<td>A string expression that yields the name of an HTTP response header. If ''name'' is not present, HeaderValue returns a zero-length string.
<td>A string expression that yields the name of an HTTP response header. If <var class="term">name</var> is not present, <var>HeaderValue</var> returns a zero-length string.
</td></tr>
</td></tr>
<tr><th>sub</th>
<tr><th>occurrence</th>
<td>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), as described in <var>[[HeaderCount (HttpResponse function)|HeaderCount]]</var>.
<td>Identifies a particular occurrence of header <var class="term">name</var>. 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 <var>[[HeaderCount (HttpResponse function)|HeaderCount]]</var>(<var class="term">name</var>).
If you specify a non-positive or non-numeric value, the request is cancelled. If ''sub'' is not explicitly specified, its default is 1.
If you specify a non-positive or non-numeric value, the request is cancelled. If <var class="term">occurence</var> is not explicitly specified, its default is 1.
</td></tr></table>


</td></tr></table>
==See also==
==See also==
{{Template:HttpResponse:HeaderValue footer}}
{{Template:HttpResponse:HeaderValue footer}}

Latest revision as of 19:41, 20 June 2011

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

%string 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