httpc_start_request


Use this function to start a request. It works in one of two ways:

  • If conn_handle is HTTPC_CONN_HDL_INVALID, it searches for a free connection and initiates a new connection to the HTTP server. 
  • Otherwise it uses the existing connection and executes the request.

Note: Before using this function, register callback functions by using httpc_register_cb().

Format

t_httpc_ret httpc_start_request (
    t_httpc_req_info *   p_req_info,
    uint16_t             conn_handle,
    uint16_t *           p_new_conn_handle,
    uint16_t *           p_req_handle )

Arguments

Name Description Type
p_req_info A pointer to the HTTP request information. t_httpc_req_info *
conn_handle A pointer to an existing connection handle or, for a new connection, HTTPC_CONN_HDL_INVALID. uint16_t
p_new_conn_handle If conn_handle is HTTPC_CONN_HDL_INVALID this returns a pointer to the new connection handle. uint16_t *
p_req_handle On return, a pointer to the request handle. This handle is used for all callbacks. uint16_t *

Return Values

Code Description
HTTPC_SUCCESS Successful execution.
HTTPC_ERROR Operation failed.