ConnectHttp: Difference between revisions

From Opale Wiki
Jump to navigation Jump to search
(Created page with " This command connects to a given FTP server on the specified GSM port. FTP server connection details are provided in parameters Prerequisites : Data link should be UP on the given port (See ConnectData) If any of required parameters is not needed it can be specified as empty string (""). Command returns once connection is established or optional timeout (entered in seconds) expired. '''COMMAND''' {| class="wikitable" !Command !Line Arguments !Returns |- |ConnectFtp...")
Tag: 2017 source edit
 
No edit summary
Line 1: Line 1:


This command connects to a given FTP server on the specified GSM port.
This command connects to a given HTTP server on the specified GSM port.


FTP server connection details are provided in parameters
FTP server connection details are provided in parameters
Line 7: Line 7:


If any of required parameters is not needed it can be specified as empty string ("").
If any of required parameters is not needed it can be specified as empty string ("").
Optional HTTP header name and value can be specified always in pair. Up to 12 HTTP headers can be specified.


Command returns once connection is established or optional timeout (entered in seconds) expired.
Command returns once connection is established or optional timeout (entered in seconds) expired.
Line 17: Line 19:
|-
|-
|ConnectFtp
|ConnectFtp
|PortIndex, FTPServerIPAddress[:Peer Port],UserName,Password [Timeout]
|PortIndex, HTTPIPAddress,UserName,Password,HTTPVersion, MaximalNumberofRedirect,ListofHTTPHeaderName, HTTPHeaderValue
|[[R2D2 Error Codes|Error Code]] in case of error.
|[[R2D2 Error Codes|Error Code]] in case of error.
|}
|}


'''OUTPUT'''
'''OUTPUT''' <br>
Command status: <br>
"%s\n", status (CONNECTED or NO INCOMING CALL)


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


~# ConnectFtp 0 ftp.acme.com "user1" "pass123"
~# ConnectHttp 0 http://www.opalesystems.com "user" "pass" 0 5 "User-Agent" "WIP-HTTP-Client/0" "Accept-Encoding" "gzip" "Accept-Language" "en-US"
FTP CONNECTED
OK
 
~# ConnectFtp 0 10.0.0.1 "user1" "pass123"
DESTINATION HOST NOT REACHABLE
 
~# ConnectFtp 1 ftp.acme.com "user1" "pass123"
DATA LINK IS DOWN


~# ConnectFtp 1 ftp.acme.com "user1" "pass"
~# ConnectHttp 1  
PASSWORD REJECTED BY SERVER
BAD PARAMETERS





Revision as of 17:42, 1 April 2025

This command connects to a given HTTP server on the specified GSM port.

FTP server connection details are provided in parameters

Prerequisites : Data link should be UP on the given port (See ConnectData)

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

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

Command returns once connection is established or optional timeout (entered in seconds) expired.

COMMAND

Command Line Arguments Returns
ConnectFtp PortIndex, HTTPIPAddress,UserName,Password,HTTPVersion, MaximalNumberofRedirect,ListofHTTPHeaderName, HTTPHeaderValue Error Code in case of error.

OUTPUT

EXAMPLE

~# ConnectHttp 0 http://www.opalesystems.com "user" "pass" 0 5 "User-Agent" "WIP-HTTP-Client/0" "Accept-Encoding" "gzip" "Accept-Language" "en-US"
OK

~# ConnectHttp 1 
BAD PARAMETERS