c0de net 0.1.0This page in English

Diese Seite ist noch nicht übersetzt. Sie wird auf Englisch angezeigt.

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

  • connection STRUCT c0de_net/http/HTTP_CONNECTION: the server
  • endpoint STRING: the path behind the base endpoint (optional, default empty)
  • data STRING: the data sent with the request (optional, default empty)
  • result result STRING: the raw data of the answer
  • result status INTEGER: the HTTP status
  • result headers HASH 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