http_response.h
Go to the documentation of this file.
1 /*!**********************************************************************
2  *
3  * @copyright Copyright (C) 2016 Siemens Aktiengesellschaft.\n
4  * All rights reserved.
5  *
6  *************************************************************************
7  *
8  * @file http_response.h
9  * @date Jul 19, 2016
10  * @brief HTTP response module header file.
11  *
12  * This module analyzes and parses received HTTP response messages.
13  *
14  ************************************************************************/
15 
16 #ifndef HTTP_RESPONSE_H_
17 #define HTTP_RESPONSE_H_
18 
19 #include "string_array.h"
20 
27 {
58 
64 typedef struct http_response_t
65 {
71 
89 
102 E_MCL_ERROR_CODE http_response_get_header(http_response_t *http_response, char *header_name, string_t **header_value);
103 
111 
119 
127 void http_response_destroy(http_response_t **http_response);
128 
129 #endif //HTTP_RESPONSE_H_
General Group Name for 1xx Error Codes.
Definition: http_response.h:29
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.
Definition: http_response.c:38
Unknown result code.
Definition: http_response.h:28
string_array_t * header
Header of http response.
Definition: http_response.h:66
E_MCL_HTTP_RESULT_CODE result_code
Result code of http response.
Definition: http_response.h:69
General Group Name for 4xx Error Codes.
Definition: http_response.h:38
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
Definition: mcl_common.h:137
mcl_size_t payload_size
Payload size of http response.
Definition: http_response.h:68
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.
Definition: http_response.c:19
E_MCL_HTTP_RESULT_CODE http_response_get_result_code(http_response_t *http_response)
Get the result code of the HTTTP Response.
Definition: http_response.c:91
mcl_uint8_t * http_response_get_payload(http_response_t *http_response)
Get the payload section of the HTTP Response.
Definition: http_response.c:83
uint8_t mcl_uint8_t
Definition: mcl_common.h:43
void http_response_destroy(http_response_t **http_response)
To destroy the HTTP Response Handler.
Definition: http_response.c:99
Actual code : 201.
Definition: http_response.h:33
General Group Name for 5xx Error Codes.
Definition: http_response.h:50
size_t mcl_size_t
Definition: mcl_common.h:38
Actual code : 200.
Definition: http_response.h:32
General Group Name for 3xx Error Codes.
Definition: http_response.h:35
E_MCL_HTTP_RESULT_CODE
HTTP Result Codes.
Definition: http_response.h:26
String array module header file.
HTTP Response Handle.
Definition: http_response.h:64
mcl_uint8_t * payload
Payload of http response.
Definition: http_response.h:67
General Group Name for 2xx Error Codes.
Definition: http_response.h:31