http_client.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_client.h
9  * @date Jul 20, 2016
10  * @brief HTTP client module header file.
11  *
12  * HTTP client is responsible of sending and receiving data through TCP/IP.
13  * It uses http_request_t and http_response_t for sending and returning the messages.
14  *
15  ************************************************************************/
16 
17 #ifndef HTTP_CLIENT_H_
18 #define HTTP_CLIENT_H_
19 
20 #include "http_response.h"
21 #include "http_request.h"
22 #include "configuration.h"
23 
24 #define SSL_CERTIFICATE_TYPE_PEM "PEM"
25 
26 typedef mcl_size_t (*http_client_read_callback)(void *buffer, mcl_size_t size, mcl_size_t count, void *user_context);
27 
29 {
31  void *user_context;
33 
37 typedef struct http_client_t http_client_t;
38 
54 
80 E_MCL_ERROR_CODE http_client_send(http_client_t *http_client, http_request_t *http_request, http_client_send_callback_info_t *callback_info, http_response_t **http_response);
81 
89 void http_client_destroy(http_client_t **http_client);
90 
97 
98 #endif //HTTP_CLIENT_H_
HTTP Request Handle.
Definition: http_request.h:79
E_MCL_ERROR_CODE http_client_send(http_client_t *http_client, http_request_t *http_request, http_client_send_callback_info_t *callback_info, http_response_t **http_response)
Send/Receive function.
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 http_client_get_callback_termination_code()
To get the implementation specific code for returning from callback function in order to terminate th...
E_MCL_ERROR_CODE http_client_initialize(configuration_t *configuration, http_client_t **http_client)
HTTP Client initializer.
HTTP Client Handler definition. Members are implementation specific and are declared in implementatio...
Configuration module header file.
http_client_read_callback read_callback
Definition: http_client.h:30
void http_client_destroy(http_client_t **http_client)
To destroy the HTTP Client Handler.
size_t mcl_size_t
Definition: mcl_common.h:38
HTTP request module header file.
HTTP Response Handle.
Definition: http_response.h:64
mcl_size_t(* http_client_read_callback)(void *buffer, mcl_size_t size, mcl_size_t count, void *user_context)
Definition: http_client.h:26
HTTP response module header file.