HttpRequest methods syntax: Difference between revisions
m (Automatically generated page update) |
(Automatically generated page update) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 9: | Line 9: | ||
<span class="term">httpRequest</span><span class="literal">:[[AutoSendXmlContentType (HttpRequest property)|AutoSendXmlContentType]]</span> <span class="literal">= </span><span class="term">newBoolean</span></p> | <span class="term">httpRequest</span><span class="literal">:[[AutoSendXmlContentType (HttpRequest property)|AutoSendXmlContentType]]</span> <span class="literal">= </span><span class="term">newBoolean</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[FieldCount (HttpRequest function)|FieldCount]]</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[FieldCount (HttpRequest function)|FieldCount]]</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%httpResponse</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Get (HttpRequest function)|Get]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Port=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="Number">Cancel=</span><span class="squareb">]</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%httpResponse</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Get (HttpRequest function)|Get]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Port=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="Number">Cancel=</span><span class="squareb">]</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> - | ||
<span class="squareb">[</span><span class="literal" title="CertificateChecker">CertificateCheck=</span> <span class="term" title="CertificateChecker">certificateChecker</span><span class="squareb">]</span><span class="comma">,</span> - | |||
<span class="squareb">[</span><span class="literal" title="Boolean">CheckKeepAliveCertificate=</span> <span class="term" title="Boolean">boolean</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p> | |||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[HeaderCount (HttpRequest function)|HeaderCount]]</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%number</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[HeaderCount (HttpRequest function)|HeaderCount]]</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Host (HttpRequest property)|Host]]</span> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Host (HttpRequest property)|Host]]</span> | ||
Line 21: | Line 23: | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentBoolean</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[MultiPartFormEncoding (HttpRequest property)|MultiPartFormEncoding]]</span> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentBoolean</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[MultiPartFormEncoding (HttpRequest property)|MultiPartFormEncoding]]</span> | ||
<span class="term">httpRequest</span><span class="literal">:[[MultiPartFormEncoding (HttpRequest property)|MultiPartFormEncoding]]</span> <span class="literal">= </span><span class="term">newBoolean</span></p> | <span class="term">httpRequest</span><span class="literal">:[[MultiPartFormEncoding (HttpRequest property)|MultiPartFormEncoding]]</span> <span class="literal">= </span><span class="term">newBoolean</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%httpRequest</span><span class="literal"> =</span> <span class="literal">%(HttpRequest):[[New (HttpRequest constructor)|New]]</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%httpRequest</span><span class="literal"> =</span> <span class="squareb">[</span><span class="literal">%(HttpRequest):</span><span class="squareb">]</span><span class="literal">[[New (HttpRequest constructor)|New]]</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Page (HttpRequest property)|Page]]</span> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Page (HttpRequest property)|Page]]</span> | ||
<span class="term">httpRequest</span><span class="literal">:[[Page (HttpRequest property)|Page]]</span> <span class="literal">= </span><span class="term">newString</span></p> | <span class="term">httpRequest</span><span class="literal">:[[Page (HttpRequest property)|Page]]</span> <span class="literal">= </span><span class="term">newString</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentNumber</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Port (HttpRequest property)|Port]]</span> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentNumber</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Port (HttpRequest property)|Port]]</span> | ||
<span class="term">httpRequest</span><span class="literal">:[[Port (HttpRequest property)|Port]]</span> <span class="literal">= </span><span class="term">newNumber</span></p> | <span class="term">httpRequest</span><span class="literal">:[[Port (HttpRequest property)|Port]]</span> <span class="literal">= </span><span class="term">newNumber</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%httpResponse</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Post (HttpRequest function)|Post]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Port=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="Number">Cancel=</span><span class="squareb">]</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%httpResponse</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Post (HttpRequest function)|Post]]</span><span class="squareb">[</span><span class="literal">(</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Port=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="Number">Cancel=</span><span class="squareb">]</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> - | ||
<span class="squareb">[</span><span class="literal" title="CertificateChecker">CertificateCheck=</span> <span class="term" title="CertificateChecker">certificateChecker</span><span class="squareb">]</span><span class="comma">,</span> - | |||
<span class="squareb">[</span><span class="literal" title="Boolean">CheckKeepAliveCertificate=</span> <span class="term" title="Boolean">boolean</span><span class="squareb">]</span><span class="literal">)</span><span class="squareb">]</span></p> | |||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">httpRequest</span><span class="literal">:[[Print (HttpRequest subroutine)|Print]]</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">httpRequest</span><span class="literal">:[[Print (HttpRequest subroutine)|Print]]</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Protocol (HttpRequest property)|Protocol]]</span> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Protocol (HttpRequest property)|Protocol]]</span> | ||
Line 35: | Line 39: | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">httpRequest</span><span class="literal">:[[RemoveProxy (HttpRequest subroutine)|RemoveProxy]]</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">httpRequest</span><span class="literal">:[[RemoveProxy (HttpRequest subroutine)|RemoveProxy]]</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%httpResponse</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Send (HttpRequest function)|Send]]</span><span class="literal">(</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Port=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="Number">Cancel=</span><span class="squareb">]</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> - | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%httpResponse</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Send (HttpRequest function)|Send]]</span><span class="literal">(</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="String">Port=</span><span class="squareb">]</span> <span class="term" title="String">string</span><span class="squareb">]</span><span class="comma">,</span> <span class="squareb">[</span><span class="squareb">[</span><span class="literal" title="Number">Cancel=</span><span class="squareb">]</span> <span class="term" title="Number">number</span><span class="squareb">]</span><span class="comma">,</span> - | ||
<span class="literal" title="String">Method=</span> <span class="term" title="String"> | <span class="squareb">[</span><span class="literal" title="CertificateChecker">CertificateCheck=</span> <span class="term" title="CertificateChecker">certificateChecker</span><span class="squareb">]</span><span class="comma">,</span> - | ||
<span class="squareb">[</span><span class="literal" title="Boolean">CheckKeepAliveCertificate=</span> <span class="term" title="Boolean">boolean</span><span class="squareb">]</span><span class="comma">,</span> - | |||
<span class="literal" title="String">Method=</span> <span class="term" title="String">name</span><span class="literal">)</span></p> | |||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">httpRequest</span><span class="literal">:[[SetAuthentication (HttpRequest subroutine)|SetAuthentication]]</span><span class="literal">(</span> <span class="term" title="String">userID</span><span class="comma">,</span> <span class="term" title="String">password</span><span class="comma">,</span> <span class="term" title="String">realm</span><span class="literal">)</span></p> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">httpRequest</span><span class="literal">:[[SetAuthentication (HttpRequest subroutine)|SetAuthentication]]</span><span class="literal">(</span> <span class="term" title="String">userID</span><span class="comma">,</span> <span class="term" title="String">password</span><span class="comma">,</span> <span class="term" title="String">realm</span><span class="literal">)</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentNumber</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Timeout (HttpRequest property)|Timeout]]</span> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentNumber</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[Timeout (HttpRequest property)|Timeout]]</span> | ||
<span class="term">httpRequest</span><span class="literal">:[[Timeout (HttpRequest property)|Timeout]]</span> <span class="literal">= </span><span class="term">newNumber</span></p> | <span class="term">httpRequest</span><span class="literal">:[[Timeout (HttpRequest property)|Timeout]]</span> <span class="literal">= </span><span class="term">newNumber</span></p> | ||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[TranslateTable (HttpRequest property)|TranslateTable]]</span> | |||
<span class="term">httpRequest</span><span class="literal">:[[TranslateTable (HttpRequest property)|TranslateTable]]</span> <span class="literal">= </span><span class="term">newString</span> | |||
Throws [[InvalidTranslateTable class|InvalidTranslateTable]]</p> | |||
<p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[URL (HttpRequest property)|URL]]</span> | <p class="syntax" style="margin-bottom:0px; border-bottom:1px solid; border-left:1px solid; border-right:1px solid; border-top: none; margin-top:0px;"><span class="term">%currentString</span><span class="literal"> =</span> <span class="term">httpRequest</span><span class="literal">:[[URL (HttpRequest property)|URL]]</span> | ||
<span class="term">httpRequest</span><span class="literal">:[[URL (HttpRequest property)|URL]]</span> <span class="literal">= </span><span class="term">newString</span></p> | <span class="term">httpRequest</span><span class="literal">:[[URL (HttpRequest property)|URL]]</span> <span class="literal">= </span><span class="term">newString</span></p> |
Latest revision as of 02:35, 17 March 2013
The syntax for each of the HttpRequest class methods is shown below.
Square brackets indicate optional elements of the method invocation. See also the notation conventions for methods and the List of HttpRequest methods.
httpRequest:AddField( fieldName, fieldValue, [file], [translate])
httpRequest:AddHeader( header, value)
httpRequest:AddLongstring( string, [xlatFlag])
httpRequest:AddXml( doc, [options])
%currentBoolean = httpRequest:AutoSendXmlContentType httpRequest:AutoSendXmlContentType = newBoolean
%number = httpRequest:FieldCount
%httpResponse = httpRequest:Get[( [[Port=] string], [[Cancel=] number], - [CertificateCheck= certificateChecker], - [CheckKeepAliveCertificate= boolean])]
%number = httpRequest:HeaderCount
%currentString = httpRequest:Host httpRequest:Host = newString
%currentString = httpRequest:HttpVersion httpRequest:HttpVersion = newString
%currentLineEnd = httpRequest:LineEnd httpRequest:LineEnd = newLineEnd
%currentNumber = httpRequest:MaxRedirects httpRequest:MaxRedirects = newNumber
%currentBoolean = httpRequest:MultiPartFormEncoding httpRequest:MultiPartFormEncoding = newBoolean
%httpRequest = [%(HttpRequest):]New
%currentString = httpRequest:Page httpRequest:Page = newString
%currentNumber = httpRequest:Port httpRequest:Port = newNumber
%httpResponse = httpRequest:Post[( [[Port=] string], [[Cancel=] number], - [CertificateCheck= certificateChecker], - [CheckKeepAliveCertificate= boolean])]
httpRequest:Print
%currentString = httpRequest:Protocol httpRequest:Protocol = newString
%currentString = httpRequest:Proxy httpRequest:Proxy = newString
httpRequest:RemoveAuthentication
httpRequest:RemoveProxy
%httpResponse = httpRequest:Send( [[Port=] string], [[Cancel=] number], - [CertificateCheck= certificateChecker], - [CheckKeepAliveCertificate= boolean], - Method= name)
httpRequest:SetAuthentication( userID, password, realm)
%currentNumber = httpRequest:Timeout httpRequest:Timeout = newNumber
%currentString = httpRequest:TranslateTable httpRequest:TranslateTable = newString Throws InvalidTranslateTable
%currentString = httpRequest:URL httpRequest:URL = newString