| Command group | Flag affected | Reversible | Execute on client | Platform(s) |
| External commands | YES | NO | NO | All |
Note: The flag is set according to whether Omnis was able to make a call to this external command.
This Web command is multi-threaded,allowing another thread to execute in the multi-threaded server while it runs. Note that the same socket cannot safely be used concurrently by more than one thread.
HTTPOpen is a client command that opens an HTTP connection to a Web server.
Hostname is a Character field containing the hostname or IP address of an HTTP server. For example:
www.myhost.com or 255.255.255.254
Service|Port is an optional parameter that specifies the service name or port number of the server. If you specify a service name, the lookup for the port number occurs locally. If you omit this argument, it defaults to 80 or 443, the default port for HTTP or HTTPS respectively (depending on the value of Secure).
Secure is an optional Boolean parameter which indicates if a secure connection is required to the server. Pass kTrue for a secure connection.
Verify is an optional Boolean parameter which is only significant when Secure is not kFalse. When Verify is kTrue, the command instructs the secure socket layer to verify the server's identity using its certificate; if the verification fails, then the connection will not be established. You can pass Verify as kFalse, to turn off this verification; in this case, the connection will still be encrypted, but there is a chance the server is an impostor.
UseProxy is an optional Boolean parameter that defaults to kTrue. If kFalse, HTTPOpen connects directly to the specified host and port. If kTrue,and proxy server parameters have been set using HTTPSetProxyServer, HTTPOpen connects to the proxy server,setting up a secure tunnel if the proxy server does not have a secure URL,but the requested connection is secure.
If HTTPOpen succeeds, socket receives a positive number which is the socket for the new connection to the server. Otherwise, socket receives a negative error code. Possible error codes are listed in the Web Command Error Codes Appendix.
# Connect to the server IP address iHostName on port iPort and send# the message iMessage
CalculateiHostNameas'0.0.0.0'
CalculateiPortas6000
CalculatelMessageas'Hello remote application'
HTTPOpen(iHostName,iPort)ReturnsiSocket
IfiSocket>0# connectedHTTPSend(iSocket,lMessage)ReturnslCharCount
End If