Page (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template:HTTPRequest:Page subtitle}}
{{Template:HttpRequest:Page subtitle}}
The <var>Page</var> settable property identifies a page path that is relative to the site root.  Such a page, or document, is what follows the host and any port number in a URL.  You set the page for an HTTP request by assigning a value to <var>Page</var>, and you fetch its value by referencing it without any parameters.


This settable property identifies a page path that is relative to the site root.
Such a page, or document,  is what follows the host and any port number in a URL.
You set the page for an HTTP request by assigning a value to <var>Page</var>,
and you fetch its value by referencing it without any parameters.
==Syntax==
==Syntax==
{{Template:HTTPRequest:Page syntax}}
{{Template:HttpRequest:Page syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%httpreq</th>
<tr><th>%currentString</th>
<td>An instantiated <var>HTTPRequest</var> object.
<td>A string or [[Longstrings|Longstring]] variable for the assignment of the current value of <var>Page</var>.
</td></tr>
</td></tr>
<tr><th>pageval</th>
<tr><th>httpRequest</th>
<td>A string expression identifying the page to fetch. It does not include a host name. If left unset, it defaults to the slash character (/), the root page for the host website.
<td>A previously defined and instantiated <var>HttpRequest</var> object.</td></tr>
<tr><th>newString</th>
<td>A string expression identifying the page to fetch. It does not include a host name. If left unset, it defaults to the slash character (/), the root page for the host website. The maximum length of the string is 1030, as of <var class="product">Sirius Mods</var> version 8.0; previously it was 255.
</td></tr>
</td></tr>
<tr><th>%curr</th>
</table>
<td>A string or longstring variable for the assignment of the current value of Page.
 
</td></tr></table>


==Example==
==Example==
 
To set the page <code>/links.html</code> as in:
As an example, the page is <code>/links.html</code> in:
<p class="code"><nowiki>http://foo.com:123/links.html</nowiki>
<p class="code"> http://foo.com:123/links.html
</p>
</p>
 
You would use:
You set this page using;
<p class="code">%httpreq:Page = '/links.html'
<p class="code">%httpreq:Page = '/links.html'
</p>
</p>
==See also==
==See also==
{{Template:HTTPRequest:Page footer}}
{{Template:HttpRequest:Page footer}}

Latest revision as of 21:12, 6 March 2012

Relative page path (HttpRequest class)

The Page settable property identifies a page path that is relative to the site root. Such a page, or document, is what follows the host and any port number in a URL. You set the page for an HTTP request by assigning a value to Page, and you fetch its value by referencing it without any parameters.

Syntax

%currentString = httpRequest:Page httpRequest:Page = newString

Syntax terms

%currentString A string or Longstring variable for the assignment of the current value of Page.
httpRequest A previously defined and instantiated HttpRequest object.
newString A string expression identifying the page to fetch. It does not include a host name. If left unset, it defaults to the slash character (/), the root page for the host website. The maximum length of the string is 1030, as of Sirius Mods version 8.0; previously it was 255.

Example

To set the page /links.html as in:

http://foo.com:123/links.html

You would use:

%httpreq:Page = '/links.html'

See also