Message (HttpResponse function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
{{Template:HttpResponse:Message subtitle}}
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
[[Category:HttpResponse methods|Message property]]
<p>
<var>Message</var> is a member of the <var>[[HttpResponse class|HttpResponse]]</var> class.
</p>


This non-settable method lets you check the HTTP
This non-settable method lets you check the HTTP
Line 13: Line 8:
a <code>403</code> <code>Forbidden</code> status line).
a <code>403</code> <code>Forbidden</code> status line).
==Syntax==
==Syntax==
<p class="syntax">%message = %httresp:Message
{{Template:HttpResponse:Message syntax}}
</p>
 
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 39: Line 32:
   . . .
   . . .
</p>
</p>
==See also==
{{Template:HttpResponse:Message footer}}

Revision as of 21:45, 17 June 2011

Return code message of most recent request (HttpResponse class)


This non-settable method lets you check the HTTP status line (return code and message) of the result of the most recent HTTP request. The Message method 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

%message A string or longstring variable for the assignment of the Message value of %httpresp.
%httpresp 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