The t_httpc_request_hdr_cb definition specifies the format of the callback function that is called to add headers before sending a request to the server.


  • The Method line, host, and user-agent must already be set in the buffer with the values specified in httpc_start_request() input parameter.
  • If specified, the content length is added by the client after calling the httpc_req_open_cb() callback.


typedef t_httpc_ret ( * t_httpc_request_hdr_cb )( 
    uint16_t           http_req_hdl,
    char_t * const     p_headers,
    uint16_t const     max_length,
    uint16_t * const   p_length_added )


Parameter Description Type
http_req_hdl The handle of the current request. uint16_t
p_headers A pointer to the buffer that contains the headers. This points to the position where the next header can be added. char_t *
max_length The length of the header buffer. uint16_t
p_length_added The length of the headers added to the buffer. uint16_t *

Return Codes

Code Description
HTTPC_SUCCESS Successful execution.
HTTPC_ERROR Operation failed.