HTTP response module header file. More...
#include "string_array.h"
Go to the source code of this file.
Data Structures | |
struct | http_response_t |
HTTP Response Handle. More... | |
Functions | |
E_MCL_ERROR_CODE | http_response_initialize (string_array_t *header, mcl_uint8_t *payload, mcl_size_t payload_size, E_MCL_HTTP_RESULT_CODE result_code, http_response_t **http_response) |
HTTP Response Module Initialize function. More... | |
E_MCL_ERROR_CODE | http_response_get_header (http_response_t *http_response, char *header_name, string_t **header_value) |
Get the value of a specified HTTP Header. More... | |
mcl_uint8_t * | http_response_get_payload (http_response_t *http_response) |
Get the payload section of the HTTP Response. More... | |
E_MCL_HTTP_RESULT_CODE | http_response_get_result_code (http_response_t *http_response) |
Get the result code of the HTTTP Response. More... | |
void | http_response_destroy (http_response_t **http_response) |
To destroy the HTTP Response Handler. More... | |
HTTP response module header file.
Definition in file http_response.h.
HTTP Result Codes.
Only most used result codes are defined. For non existing ones, the general group names will be used ( e.g. MCL_HTTP_RESULT_CODE_GENERAL_REDIRECTION_3XX )
Definition at line 26 of file http_response.h.
void http_response_destroy | ( | http_response_t ** | http_response | ) |
To destroy the HTTP Response Handler.
Will release the resources of HTTP Response Handler. After destroy operation, handler shouldn't be used.
[in] | http_response | HTTP Response Handle. |
Definition at line 99 of file http_response.c.
References DEBUG_ENTRY, DEBUG_LEAVE, MCL_DEBUG, MCL_FREE, MCL_NULL, and string_array_destroy().
Referenced by _exchange_evaluate_response(), http_processor_get_access_token(), and http_processor_register().
E_MCL_ERROR_CODE http_response_get_header | ( | http_response_t * | http_response, |
char * | header_name, | ||
string_t ** | header_value | ||
) |
Get the value of a specified HTTP Header.
[in] | http_response | HTTP Response handle to be used. |
[in] | header_name | Name of the header whose value is requested. |
[out] | header_value | Valur of the header will be stored in header_value .
|
Definition at line 38 of file http_response.c.
References ASSERT_CODE, ASSERT_CODE_MESSAGE, string_t::buffer, mcl_list_t::count, mcl_list_node_t::data, DEBUG_ENTRY, DEBUG_LEAVE, mcl_list_t::head, http_response_t::header, string_array_t::index, list_destroy_with_content(), MCL_DEBUG, MCL_FAIL, MCL_NULL, MCL_OK, MCL_TRUE, mcl_list_node_t::next, string_array_get(), string_destroy(), string_initialize(), string_split(), and string_util_find_case_insensitive().
Referenced by _process_registration_response_rsa_3072(), and http_processor_get_access_token().
mcl_uint8_t* http_response_get_payload | ( | http_response_t * | http_response | ) |
Get the payload section of the HTTP Response.
[in] | http_response | HTTP Response handle to be used. |
http_response
. Definition at line 83 of file http_response.c.
References DEBUG_ENTRY, DEBUG_LEAVE, and http_response_t::payload.
Referenced by _process_registration_response_rsa_3072(), _process_registration_response_shared_secret(), and http_processor_get_access_token().
E_MCL_HTTP_RESULT_CODE http_response_get_result_code | ( | http_response_t * | http_response | ) |
Get the result code of the HTTTP Response.
[in] | http_response | HTTP Response handle to be used. |
Definition at line 91 of file http_response.c.
References DEBUG_ENTRY, DEBUG_LEAVE, and http_response_t::result_code.
E_MCL_ERROR_CODE http_response_initialize | ( | string_array_t * | header, |
mcl_uint8_t * | payload, | ||
mcl_size_t | payload_size, | ||
E_MCL_HTTP_RESULT_CODE | result_code, | ||
http_response_t ** | http_response | ||
) |
HTTP Response Module Initialize function.
Create and initializes an http_response_t object and sets its result code if not received.
[in] | header | String array for the received HTTP Header. |
[in] | payload | The received HTTP Payload. |
[in] | payload_size | Size of payload . |
[in] | result_code | The received status code. If this is 0, http_response_initialize will extract the result code from the message itself. |
[out] | http_response | Handle of the initialized http_response_t object. |
Definition at line 19 of file http_response.c.
References ASSERT_CODE_MESSAGE, DEBUG_ENTRY, DEBUG_LEAVE, MCL_NEW, MCL_NULL, MCL_OK, and MCL_OUT_OF_MEMORY.
Referenced by http_client_send().