Up |
Send a http request to a specific url with a specific verb (which would probably be POST). This is asynchronous. When server responds, the callback is fired, with following arguments.
fun [Chn S S S S I fun [INET u0 S I] u1 u0] INET
Return : INET a connection object or nil if error
Error :
INETGetURLex (DEPRECATED) returns the same errors.
fun send_callback (inet, user_param, data, err)=
if err == 0 then // the response is not finished
// to do something
else if err == 1 then // the response is ok and finished
// to do something
else // an error occurs
// to do something
0;;
fun send_request (address, verb, param)=
INETGetURLex2
_channel
verb // "POST", "GET", "HEAD", ...
address
"content-type: application/x-www-form-urlencoded" // request header, if any
param // content to send
0 // should stay at 0
@send_callback // callback to the response
0; // user parameter
0;;
The function INETGetURLex shound not be used in a new application ! Use this function instead !