C Collections

chttpclient · Section 3

chttp_post

chttp_post - do a POST request with the default client

C Collections (libccollections, -lccollections)

#include <ccollections/chttpclient.h>
 
ccol_retval chttp_post(const char *url,
                         const chttp_request_body *body,
                         chttpcli_response **resp_out);

This is a convenience wrapper that sends an HTTP POST. Pass a NULL body
for a POST without one.

The same codes as chttpcli_do, plus ccol_invalid_args for a body
whose data is NULL while its len is not zero, which
chttp_request_create refuses. ccol_not_enough_memory also covers a
failed allocation of the internal request object.

chttp_get(3), chttp_do_default(3)