The t_httpc_req_open_cb definition specifies the format of the callback function that is called before a PUT or POST request is sent.

The user implementation (based on the request method) can decide whether a resource needs to be allocated (for example, a file in the PUT or POST cases). If the resource it tries to allocate is not currently available (for example, because there is no free file handle), it can signal that a later retry is required.


typedef t_httpc_ret ( * t_httpc_req_open_cb ) (
    uint16_t                   http_req_hdl,
    uint32_t * const           req_clen,
    t_httpc_user_hdl * const   p_hdl )


Parameter Description Type
http_req_hdl The handle of the current request. uint16_t
req_clen The length of the data to be sent. uint32_t *
p_hdl Where to write the internal handle. This handle is used by the req_read() and req_close() calls. t_httpc_user_hdl *

Return Codes

Code Description
HTTPC_SUCCESS Successful execution.
HTTPC_RETRY The client must retry later.
HTTPC_ERROR Operation failed.