restClientRequest (Function) |
Top Previous Next |
This function will execute a client request and wait for the response. If the path parameter is not set, the body of the response will be stored in memory and can be read using the restRespBodyGetString, restRespBodyGetJSON and restRespBodyGetRaw functions. The maximum response size of a response in memory is 1 MB. If the path parameter is set, the body content will instead be written to the file. The file will be created even if the request fails, e.g. because it can not find the server. If the request fails because the connection times out or if there is not enough free space for the entire file, the data that was received will still be available in the file.
Input: req : SYSHANDLE The request to execute.
path : STRING The path to a file to store the response in.
iface : SINT (Default 0) The network interface to use for the request. 0 = Any network, 1 = Mobile network, 2 = LAN network, etc. (See Network).
Output: resp : SYSHANDLE A handle to the response to the request. Must be freed with restRespFree when no longer needed.
Returns: INT
Declaration: FUNCTION restClientRequest : INT;
Example: Please see the "Examples - REST Example"
|