restReqCreate (Function) |
Top Previous Next |
This function will create a new request that can be executed by calling restClientRequest. To free the request when it is no longer needed, call restReqFree. This request can both be written and read. There can maximum be 20 requests at the same time. This includes requests used for the server endpoint callbacks, see restServerEndpointAdd.
Input: method : STRING (default "GET") The HTTP method to use for the request.
url : STRING The URL of the request, including the protocol ("http://" or "https://").
check_server: BOOL (default TRUE) Set to FALSE to not validate the server certificate when using TLS.
check_hostname : BOOL Set to FALSE to not validate the hostname of the server when using TLS. This is useful if the server uses a dynamic IP address so the server certificate is not able to match the hostname.
follow_redirect: BOOL (default FALSE) Set to TRUE to follow HTTP redirects, which could cause it to receive content that does not match the expected content. By leaving it at FALSE, any redirect response will be returned and can be manually handled.
timeout: INT (default 20) The timeout in seconds before canceling the request.
Output: req : SYSHANDLE A handle to the new request.
Returns: INT
Declaration: FUNCTION restReqCreate : INT;
Example: INCLUDE rtcu.inc |