Proxy (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (match syntax table to syntax template; edits, tags and links)
Line 1: Line 1:
{{Template:HttpRequest:Proxy subtitle}}
{{Template:HttpRequest:Proxy subtitle}}
The <var>Proxy</var> settable method permits the use of proxy servers with the <var>HttpRequest</var> object.


This settable method permits the use of proxy servers with the
If you specify a proxy server by setting <var>Proxy</var>, subsequent <var>[[Get_(HttpRequest_function)|Get]]</var>, <var>[[Post_(HttpRequest_function)|Post]]</var>, and <var>[[Send_(HttpRequest_function)|Send]]</var> calls use this proxy server.  If referenced by an <var>HttpRequest</var> object, <var>Proxy</var> returns the current proxy server (or a zero length string, if no proxy was set).
<var>HttpRequest</var> object.


If you specify a proxy server by setting Proxy,
subsequent Get, Post, and Send calls use this proxy server.
If referenced by an <var>HttpRequest</var> object, <var>Proxy</var> returns the
current proxy server (or a zero length string, if no proxy was set).
==Syntax==
==Syntax==
{{Template:HttpRequest:Proxy syntax}}
{{Template:HttpRequest:Proxy syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%httpreq</th>
<tr><th>%currentString</th>
<td>A previously defined and instantiated <var>HttpRequest</var> object.
<td>The string or <var>[[Longstrings|Longstring]]</var> variable for the assignment of the current value of <var>Proxy</var>. If no <var>Proxy</var> value has been set, <var class="term">currentString</var> is assigned a zero-length string.</td></tr>
</td></tr>
<tr><th>httpRequest</th>
<tr><th><var>ProxyServer</var></th>
<td>A previously defined and instantiated <var>HttpRequest</var> object.</td></tr>
<td>Identifies the proxy server to use, and is of form: <p class="code"> [Protocol://]Host[:Port] </p> <ul> <li>Protocol is <code>http</code> or <code>https</code> and defaults to <code>http</code>. It controls the protocol used for the connection to the proxy server. <li>Host specifies either the IP number or the DNS name of the proxy server. It must be specified or the request is cancelled. <li>Port specifies the port number for the proxy server. If it is not specified, the default for the protocol (http is 80, and https is 443) is used. </ul>
<tr><th>newString</th>
</td></tr>
<td>Identifies the proxy server to use, and is of form:
<tr><th>%curr</th>
<p class="code"> [Protocol://]Host[:Port] </p>
<td>The string or longstring variable for the assignment of the current value of <var>Proxy</var>. If no <var>Proxy</var> value has been set, ''%curr'' is assigned a zero-length string.
<ul>
 
<li>Protocol is <code>http</code> or <code>https</code> and defaults to <code>http</code>. It controls the protocol used for the connection to the proxy server.
</td></tr></table>
<li>Host specifies either the IP number or the DNS name of the proxy server. It must be specified or the request is cancelled.
<li>Port specifies the port number for the proxy server. If it is not specified, the default for the protocol (http is 80, and https is 443) is used.
</ul></td></tr>
</table>


==Usage notes==
==Usage notes==
<ul>
<li>If <var>Proxy</var> is set multiple times, the most recent setting is used as the proxy server.
</ul>


If <var>Proxy</var> is set multiple times, the most recent setting is used
as the proxy server.
==See also==
==See also==
{{Template:HttpRequest:Proxy footer}}
{{Template:HttpRequest:Proxy footer}}

Revision as of 04:23, 19 June 2011

Permit use of proxy server? (HttpRequest class)

The Proxy settable method permits the use of proxy servers with the HttpRequest object.

If you specify a proxy server by setting Proxy, subsequent Get, Post, and Send calls use this proxy server. If referenced by an HttpRequest object, Proxy returns the current proxy server (or a zero length string, if no proxy was set).

Syntax

%currentString = httpRequest:Proxy httpRequest:Proxy = newString

Syntax terms

%currentString The string or Longstring variable for the assignment of the current value of Proxy. If no Proxy value has been set, currentString is assigned a zero-length string.
httpRequest A previously defined and instantiated HttpRequest object.
newString Identifies the proxy server to use, and is of form:

[Protocol://]Host[:Port]

  • Protocol is http or https and defaults to http. It controls the protocol used for the connection to the proxy server.
  • Host specifies either the IP number or the DNS name of the proxy server. It must be specified or the request is cancelled.
  • Port specifies the port number for the proxy server. If it is not specified, the default for the protocol (http is 80, and https is 443) is used.

Usage notes

  • If Proxy is set multiple times, the most recent setting is used as the proxy server.

See also