WL865E4-P  36.07.001
m2mb_httpc.h File Reference

This file contains the APIs for HTTP client operations. More...

#include "nwk/m2mb_ssl.h"
#include "m2mb_uart.h"
#include "m2mb_dbg.h"

Go to the source code of this file.

Data Structures

struct  M2MB_HTTPC_RESPONSE
 HTTP client response. More...
 
struct  M2MB_HTTPC_CTX
 
#define M2MB_HTTPC_DEBUG_PRINT_ENABLE
 
#define M2MB_HTTPC_DBG_PRINTF   m2mb_dbg_consol_print
 
#define HTTPCLIENT_MAX_URL_LENGTH   128
 
enum  M2MB_HTTPC_RESULT {
  M2MB_HTTPC_SUCCESS = 0,
  M2MB_HTTPC_ERROR,
  M2MB_HTTPC_ERR_INVALID_PARAM,
  M2MB_HTTPC_ERR_NO_MEMORY,
  M2MB_HTTPC_ERR_NO_RESOURCE,
  M2MB_HTTPC_ERR_BUSY = 6,
  M2MB_HTTPC_ERR_NO_ENTRY,
  M2MB_HTTPC_ERR_NOT_SUPPORTED,
  M2MB_HTTPC_ERR_TIMEOUT,
  M2MB_HTTPC_ERR_BOUNDS,
  M2MB_HTTPC_ERR_BAD_PAYLOAD,
  M2MB_HTTPC_ERR_EXISTS,
  M2MB_HTTPC_CONTINUE
}
 
enum  M2MB_HTTPC_METHODS {
  M2MB_HTTPC_METHOD_INVALID = 0,
  M2MB_HTTPC_METHOD_GET_E = 1,
  M2MB_HTTPC_METHOD_HEAD_E,
  M2MB_HTTPC_METHOD_POST_E,
  M2MB_HTTPC_METHOD_PUT_E,
  M2MB_HTTPC_METHOD_DELETE_E,
  M2MB_HTTPC_METHOD_CONNECT_E,
  M2MB_HTTPC_METHOD_PATCH_E,
  M2MB_HTTPC_METHOD_MAX_E
}
 For use with m2mb_httpc_request. More...
 
enum  M2MB_HTTPC_STATES {
  M2MB_HTTPC_RX_ERROR_SERVER_CLOSED = -8,
  M2MB_HTTPC_RX_ERROR_RX_PROCESS = -7,
  M2MB_HTTPC_RX_ERROR_RX_HTTP_HEADER = -6,
  M2MB_HTTPC_RX_ERROR_INVALID_RESPONSECODE = -5,
  M2MB_HTTPC_RX_ERROR_CLIENT_TIMEOUT = -4,
  M2MB_HTTPC_RX_ERROR_NO_BUFFER = -3,
  M2MB_HTTPC_RX_CONNECTION_CLOSED = -2,
  M2MB_HTTPC_RX_ERROR_CONNECTION_CLOSED = -1,
  M2MB_HTTPC_RX_FINISHED = 0,
  M2MB_HTTPC_RX_MORE_DATA = 1
}
 HTTP client callback state. More...
 
typedef enum M2MB_HTTPC_RESULT M2MB_HTTPC_RESULT_E
 
typedef enum M2MB_HTTPC_METHODS M2MB_HTTPC_METHODS_E
 For use with m2mb_httpc_request. More...
 
typedef enum M2MB_HTTPC_STATES M2MB_HTTPC_STATES_E
 HTTP client callback state. More...
 
typedef struct M2MB_HTTPC_RESPONSE M2MB_HTTPC_RESPONSE_T
 HTTP client response. More...
 
typedef VOID(* M2MB_HTTPC_CB_T) (VOID *arg, signed int state, VOID *value)
 User registered callback for returning response message. More...
 
typedef struct M2MB_HTTPC_CTX M2MB_HTTPC_CTX_T
 
M2MB_HTTPC_RESULT_E m2mb_httpc_start ()
 (Re)starts the HTTP client module. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_stop ()
 Stops the HTTP client module. More...
 
VOIDm2mb_httpc_session_create (UINT32 timeout, M2MB_HTTPC_CB_T cb, VOID *cb_arg, UINT16 httpc_max_body_len, UINT16 httpc_max_Header_len, UINT16 httpc_Rx_Buffer_Size, VOID *m2mbSslCtx)
 create http client session. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_enable_http_response_header (VOID *handle, UINT16 enable)
 Enables/disables the addition of an HTTP header in a session callback. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_session_abort (VOID *handle)
 Aborts an HTTP client session. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_connect (VOID *handle, UINT8 *url, UINT16 port)
 Connects to an HTTP server in Blocking mode. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_disconnect (VOID *handle)
 Disconnects from an HTTP server . More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_request (VOID *handle, M2MB_HTTPC_METHODS_E method, UINT8 *url)
 Send an HTTP request to an HTTP server or proxy. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_set_request_body (VOID *handle, UINT8 *body, UINT32 body_length, UINT32 total_length)
 Sets the body on an HTTP client session. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_set_cgi_params (VOID *handle, UINT8 *arg, UINT8 *value)
 Forms a URL-encoded string on an HTTP client session. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_set_header (VOID *handle, UINT8 *hdr_name, UINT8 *hdr_value)
 Sets the header field for an HTTP client session. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_clear_all_headers (VOID *handle)
 Clears the header field for an HTTP client session. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_session_getInfo (VOID *handle, M2MB_IP46_ADDR_T *ipv6, INT32 *socket)
 Sets HTTP socket information from the http client session. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_send (VOID *handle, UINT8 isFirstPacket, UINT8 *body, UINT32 body_length, UINT32 total_length)
 Send HTTP information from the http client session. More...
 
M2MB_HTTPC_RESULT_E m2mb_httpc_set_request (VOID *handle, M2MB_HTTPC_METHODS_E method, UINT8 *url)
 Set the http request. More...
 

Detailed Description

This file contains the APIs for HTTP client operations.

we866e4/epl/inc/nwk/m2mb_httpc.h

This file has APIs for handling HTTP client operations.

Note
Dependencies:
Author
Ranjitakumar Mahapatra
Date
15/09/2018

Definition in file m2mb_httpc.h.