t_httpc_resp_open_cb


The t_httpc_resp_open_cb definition specifies the format of the callback function that is called when a response is received.

The user implementation (based on the request method) can decide whether a resource needs to be allocated. If it tries to do this and the resource is not currently available (for example, because there is no free file handle), it can signal that a later retry is needed. This function can be called to any kind of method that has a content greater than zero.

Note: Always call this function from the same task context as t_httpc_req_open_cb().

Format

typedef t_httpc_ret ( * t_httpc_resp_open_cb ) (
    uint16_t                   http_req_hdl,
    t_httpc_user_hdl * const   p_new_hdl )

Arguments

Parameter Description Type
http_req_hdl The handle of the current request returned by t_httpc_req_open_cb(). uint16_t
p_new_hdl Where to write the new handle. This handle is used by the resp_write() and resp_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.