Typedefs | Functions
Serval_HttpClient.h File Reference

Interface for HTTP clientThis interface provides a function to send HTTP POST requests. More...

#include <Serval_Defines.h>
#include <Serval_Msg.h>
#include <Serval_Http.h>
#include <Serval_Ip.h>
#include <Serval_Callable.h>
+ Include dependency graph for Serval_HttpClient.h:

Typedefs

typedef retcode_t(* HttpAppRespCallback_T )(HttpSession_T *httpSession_ptr, Msg_T *msg_ptr, retcode_t status)
 

Functions

retcode_t HttpClient_initialize (void)
 
retcode_t HttpClient_initRequest (Ip_Address_T *addr_ptr, Ip_Port_T port, Msg_T **msg_pptr)
 
retcode_t HttpClient_pushRequest (Msg_T *msg_ptr, Callable_T *sentCallback_ptr, HttpAppRespCallback_T respCallback_ptr)
 

Typedef Documentation

typedef retcode_t(* HttpAppRespCallback_T)(HttpSession_T *httpSession_ptr, Msg_T *msg_ptr, retcode_t status)

A data type representing a callback function pointer for HTTP Client application. The application uses such callback functions in order to be notified about the received messages.

Function Documentation

retcode_t HttpClient_initialize ( void  )

Initializes the HTTP client including all needed used modules.

Returns
RC_OK if successful
RC_HTTP_CLIENT_INIT_ERROR if not successful
retcode_t HttpClient_initRequest ( Ip_Address_T addr_ptr,
Ip_Port_T  port,
Msg_T **  msg_pptr 
)

This function is called to initiate a request from HTTP client. This function provides the message to be filled for sending the request.

Parameters
[in]addr_ptrThe destination IP address.
[in]portThe destination port number.
[out]msg_pptrThis holds the reference to message to be filled by application for request.
Returns
RC_OK, if successful
RC_HTTP_CLIENT_PENDING_CONNECTION, if there is a request to the same destination already pending
RC_HTTP_CLIENT_INIT_REQ_FAILED, if it is not able to initiate a new request
retcode_t HttpClient_pushRequest ( Msg_T msg_ptr,
Callable_T sentCallback_ptr,
HttpAppRespCallback_T  respCallback_ptr 
)

This function is called to push a request from HTTP client. This function prepares the message for further processing before passing it to the lower layers.

Parameters
[in]msg_ptrThis is the reference to the Msg_T object which should be sent.
[in]sentCallback_ptrThis is the reference to the callback function which is invoked to inform the application about the status of sending.
[in]respCallback_ptrThis is callback function which is invoked to inform the application of an incoming response.
Returns
RC_OK, if successful
RC_HTTP_SEND_ERROR
RC_HTTP_CLIENT_CONNECT_ERROR

This documentation file has been automatically generated on Fri Oct 4 2019 03:47:20 by doxygen 1.8.8