URL (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 1: Line 1:
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
{{Template:HTTPRequest:URL subtitle}}
[[Category:HTTPRequest methods|Url property]]


This method lets you set or examine the whole URL with one
This method lets you set or examine the whole URL with one
Line 10: Line 9:
and you fetch its value by referencing it without any parameters.
and you fetch its value by referencing it without any parameters.
==Syntax==
==Syntax==
<p class="syntax">%httpreq:Url = urlvalue
{{Template:HTTPRequest:URL syntax}}
 
%url = %httpreq:Url
</p>
 
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 34: Line 29:
it was set in one call using <var>Url</var>, or set in parts
it was set in one call using <var>Url</var>, or set in parts
using the <var>Protocol</var>, <var>Host</var>, <var>Port</var>, and <var>Page</var> properties.
using the <var>Protocol</var>, <var>Host</var>, <var>Port</var>, and <var>Page</var> properties.
==See also==
{{Template:HTTPRequest:URL footer}}

Revision as of 18:35, 15 June 2011

Template:HTTPRequest:URL subtitle

This 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

Template:HTTPRequest:URL syntax

Syntax terms

%httpreq An instantiated HTTPRequest object.
urlvalue 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 urlvalue 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, 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; Page defaults to / (the root page from the domain).

%url A string or longstring variable for the assignment of the current value of Url.

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

Template:HTTPRequest:URL footer