Message (HttpResponse function)

From m204wiki
Revision as of 06:04, 19 June 2011 by Goff (talk | contribs)
Jump to navigation Jump to search

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

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

Examples

  1. 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