Proxy (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
 
(7 intermediate revisions by 4 users not shown)
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 Proxy. 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.
<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>


</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}}
<ul>
<li>The current proxy setting can be cleared with <var>[[RemoveProxy_(HttpRequest_subroutine)|RemoveProxy]]</var>.
</ul>
{{Template:HttpRequest:Proxy footer}}

Latest revision as of 04:29, 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

  • The current proxy setting can be cleared with RemoveProxy.