URL (HttpRequest property)

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

Target HTTP request URL (HttpRequest class)

The URL method lets you set or examine the whole URL with one method call, instead of setting/getting parts of the URL with the Protocol, Host, Port, and Page properties.

You set the URL for an HTTP request by assigning a value to Url, and you fetch its value by referencing it without any parameters.

Syntax

%currentString = httpRequest:URL httpRequest:URL = newString

Syntax terms

currentString A string or Longstring variable for the assignment of the current value of Url.
httpRequest A previously defined and instantiated HttpRequest object.
newString A string expression that contains a complete URL, potentially including protocol, host, port, and page. The value is parsed and validated, and its parts are then available to the individual property calls (Protocol, Host, Port, Page). If newString cannot be parsed, the request is cancelled.

The default value is the concatenation of the defaults of the properties that return the individual parts of the URL; and is the URL of a web server running on the same machine as the client:

http://127.0.0.1:80/

Port defaults to 80; Protocol defaults to http://; Host defaults to 127.0.0.1; and Page defaults to / (the root page from the domain).

Usage notes

  • Referencing Url returns the entire URL, whether it was set in one call using Url, or set in parts using the Protocol, Host, Port, and Page properties.

See also