Message (HttpResponse function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 6: Line 6:
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%message</th>
<tr><th>%string</th>
<td>A string or longstring variable for the assignment of the Message value of ''%httpresp''.
<td>A string or longstring variable for the assignment of the <var>Message</var> value of <var class="term">httpResponse</var>.
</td></tr>
</td></tr>
<tr><th>httpResponse</th>
<tr><th>httpResponse</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 <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>
</table>
</table>


==Examples==
==Examples==
<ol><li>In the following fragment, an XML document is being retrieved.  In the event of an error, the text of the status message is printed:
In the following fragment, an XML document is being retrieved.  In the event of an error, the text of the status message is printed:
<p class="code">  . . .
<p class="code">  . . .
   %httpresp = %httpreq:get('HHELPCLI', 0)
   %httpresp = %httpreq:get('HHELPCLI', 0)
Line 24: Line 24:
     end if
     end if
   . . .
   . . .
</p></ol>
</p>


==See also==
==See also==
{{Template:HttpResponse:Message footer}}
{{Template:HttpResponse:Message footer}}

Latest revision as of 19:39, 20 June 2011

Return code message of most recent request (HttpResponse class)

The Message non-settable method lets you examine the HTTP status line (return code and message) of the result of the most recent HTTP request. Message returns only the message portion of the status line (for example, Forbidden is returned from a 403 Forbidden status line).

Syntax

%string = httpResponse:Message

Syntax terms

%string A string or longstring variable for the assignment of the Message value of httpResponse.
httpResponse A reference to an HttpResponse object that was returned by a Get, Post, or Send method of an HttpRequest object.

Examples

In the following fragment, an XML document is being retrieved. In the event of an error, the text of the status message is printed:

. . . %httpresp = %httpreq:get('HHELPCLI', 0) if (%httpresp:success) then %rc = %httpresp:parseXML(%mydoc) %mydoc:print else print %httpresp:message end if . . .

See also