restServerCreate (Function) |
Top Previous Next |
This function will create a new REST server. To free the server again, call restServerFree. A maximum of two servers can be created at the same time.
Input: port : DINT The port to listen on.
iface : SINT (default 0) The network interface to listen on. 0 = Any network, 1 = Mobile network, 2 = LAN network, etc. (See Network). When listening to the WLAN interface, it may be necessary to wait until the network is connected before starting the server with restServerStart.
cert : STRING The name of the server certificate to use with TLS. Leave empty to not use TLS. See Certificates for more details about how to work with the certificates.
key : STRING Private key for server certificate. Leave empty if not used or if it is included in the server certificate.
key_pass : STRING Password for the private key.
accept_ca: STRING The name of a root certificate. If it is specified, the clients are asked to provide a client certificate signed by it. The client certificate will be made available as part of the request, see restReqClientCertPresent.
Output: handle : SYSHANDLE A handle to the server.
Returns: INT
Declaration: FUNCTION restServerCreate : INT;
Example: |