ExecuteHttpMethod: Difference between revisions

From Opale Wiki
Jump to navigation Jump to search
(Created page with " This command allows to accept an incoming call once presented on the specified port. '''COMMAND''' {| class="wikitable" !Command !Line Arguments !Returns |- |ExecuteHttpMethod |PortIndex |Error Code in case of error. |} '''OUTPUT''' Command status: <br> "%s\n", status (CONNECTED or NO INCOMING CALL) '''EXAMPLE''' <syntaxhighlight lang="text"> ~# AcceptCall 0<br> CONNECTED<br> ~# AcceptCall 2<br> NO INCOMING CALL </syntaxhighlight> Category...")
Tag: 2017 source edit
 
No edit summary
Line 1: Line 1:


This command executes HTTP method on the specified GSM port.


This command allows to accept an incoming call once presented on the specified port.
It requires an active connection to HTTP server on the specified GSM port.
 
HTTP method can be GET, PUT, DELETE or POST. Input file path is used for PUT and POST methods, output file path is used for GET, DELETE and POST methods.
 
If any of required parameter is not needed it can be specified as NULL string ("").
 
Optional HTTP header name and value should be specified always in pair. Up to 12 HTTP headers can be specified.
 
Command waits until data is transferred or timer expires.


'''COMMAND'''
'''COMMAND'''
Line 10: Line 19:
|-
|-
|ExecuteHttpMethod
|ExecuteHttpMethod
|PortIndex  
|PortIndex, HTTPMethod, URL, UserName, Password, FilePath, ListPairsHTTPHeaderName-HTTPHeaderValue
|[[R2D2 Error Codes|Error Code]] in case of error.
|[[R2D2 Error Codes|Error Code]] in case of error.
|}
|}


'''OUTPUT'''
'''OUTPUT'''
Command status: <br>
 
"%s\n", status (CONNECTED or NO INCOMING CALL)
Success or Error Message (See [[Data Messages|Data Commands Messages]])


'''EXAMPLE''' <syntaxhighlight lang="text">
'''EXAMPLE''' <syntaxhighlight lang="text">


~# AcceptCall 0<br>
~# ExecuteHttpMethod 0 GET www.acme.com "user" "pass" """/tmp/test/url.html" "Accept" "text/html" "Transfer-coding" "compress"
CONNECTED<br>
OK
 
~# ExecuteHttpMethod 0 GET www.acme.com "user" "wrongpass" """/tmp/test/url.html" "Accept" "text/html" "Transfer-coding" "compress"
AUTHENTICATION FAILED


~# AcceptCall 2<br>
~# ExecuteHttpMethod 1 GET www.acme.com "" "" "" "/tmp/test/url.html" "Accept"
NO INCOMING CALL
BAD PARAMETERS


~# ExecuteHttpMethod 0 POST www.acme.com "user" "pass" "/tmp/test/put.htm" "/tmp/test/url.html" "Accept" "text/html" "Transfer-coding" "compress"
OK
</syntaxhighlight>
</syntaxhighlight>
[[Category:Voice]]
[[Category:Voice]]
[[Category:R2D2]]
[[Category:R2D2]]

Revision as of 18:13, 1 April 2025

This command executes HTTP method on the specified GSM port.

It requires an active connection to HTTP server on the specified GSM port.

HTTP method can be GET, PUT, DELETE or POST. Input file path is used for PUT and POST methods, output file path is used for GET, DELETE and POST methods.

If any of required parameter is not needed it can be specified as NULL string ("").

Optional HTTP header name and value should be specified always in pair. Up to 12 HTTP headers can be specified.

Command waits until data is transferred or timer expires.

COMMAND

Command Line Arguments Returns
ExecuteHttpMethod PortIndex, HTTPMethod, URL, UserName, Password, FilePath, ListPairsHTTPHeaderName-HTTPHeaderValue Error Code in case of error.

OUTPUT

Success or Error Message (See Data Commands Messages)

EXAMPLE

~# ExecuteHttpMethod 0 GET www.acme.com "user" "pass" """/tmp/test/url.html" "Accept" "text/html" "Transfer-coding" "compress"
OK

~# ExecuteHttpMethod 0 GET www.acme.com "user" "wrongpass" """/tmp/test/url.html" "Accept" "text/html" "Transfer-coding" "compress"
AUTHENTICATION FAILED

~# ExecuteHttpMethod 1 GET www.acme.com "" "" "" "/tmp/test/url.html" "Accept"
BAD PARAMETERS

~# ExecuteHttpMethod 0 POST www.acme.com "user" "pass" "/tmp/test/put.htm" "/tmp/test/url.html" "Accept" "text/html" "Transfer-coding" "compress"
OK