The t_httpc_resp_write_cb definition specifies the format of the callback function that is called to pass data received in the response.

The implementation can decide how to process the data (for example, to store it in a structure or a file).

Note: This function is always called from the same task context as t_httpc_resp_open_cb().


typedef t_httpc_ret ( * t_httpc_resp_write_cb ) (
    uint16_t                  http_req_hdl,
    const t_httpc_user_hdl    hdl,
    uint8_t * const           p_buf,
    const uint16_t            buf_len )


Parameter Description Type
http_req_hdl The handle of the current request. uint16_t
hdl The internal handle returned by t_httpc_resp_open_cb(). t_httpc_user_hdl
p_buf Where to write the data received. uint8_t *
buf_len The length of the data received. uint16_t

Return Codes

Code Description
HTTPC_SUCCESS Successful execution.
HTTPC_ERROR Operation failed.