HTTP_POST
Sends a POST request: sends data to the server, e.g. to create something.
The data is sent as UTF-8. Set its type in the Content-Type header of the connection. Make the data with TO_JSON of c0de/strings.
Parameters and results
connectionSTRUCT c0de_net/http/HTTP_CONNECTION: the serverendpointSTRING: the path behind the base endpoint (optional, default empty)dataSTRING: the data sent with the request (optional, default empty)- result
resultSTRING: the raw data of the answer - result
statusINTEGER: the HTTP status - result
headersHASH STRING: the headers of the answer
Example
c0de
CALL c0de_net/http/HTTP_POST
PARAMETER connection api ;
PARAMETER endpoint "/messages" ;
PARAMETER data message ;
RESULT result answer