u-blox modem HTTP client test
Dependencies: UbloxUSBModem mbed
HTTPMap Class Reference
Map of key/value pairs Used to transmit POST data using the application/x-www-form-urlencoded encoding. More...
#include <HTTPMap.h>
Inherits IHTTPDataOut.
Public Member Functions | |
HTTPMap () | |
Instantiates HTTPMap It supports at most 32 key/values pairs. | |
void | put (const char *key, const char *value) |
Put Key/Value pair The references to the parameters must remain valid as long as the clear() function is not called. | |
void | clear () |
Clear table. | |
Protected Member Functions | |
virtual void | readReset () |
Reset stream to its beginning Called by the HTTPClient on each new request. | |
virtual int | read (char *buf, size_t len, size_t *pReadLen) |
Read a piece of data to be transmitted. | |
virtual int | getDataType (char *type, size_t maxTypeLen) |
Get MIME type. | |
virtual bool | getIsChunked () |
Determine whether the HTTP client should chunk the data Used for Transfer-Encoding header. | |
virtual size_t | getDataLen () |
If the data is not chunked, get its size Used for Content-Length header. | |
Friends | |
class | HTTPClient |
Detailed Description
Map of key/value pairs Used to transmit POST data using the application/x-www-form-urlencoded encoding.
Definition at line 31 of file HTTPMap.h.
Constructor & Destructor Documentation
HTTPMap | ( | ) |
Instantiates HTTPMap It supports at most 32 key/values pairs.
Definition at line 30 of file HTTPMap.cpp.
Member Function Documentation
void clear | ( | ) |
Clear table.
Definition at line 46 of file HTTPMap.cpp.
size_t getDataLen | ( | ) | [protected, virtual] |
If the data is not chunked, get its size Used for Content-Length header.
Implements IHTTPDataOut.
Definition at line 150 of file HTTPMap.cpp.
int getDataType | ( | char * | type, |
size_t | maxTypeLen | ||
) | [protected, virtual] |
Get MIME type.
- Parameters:
-
type Internet media type from Content-Type header
Implements IHTTPDataOut.
Definition at line 138 of file HTTPMap.cpp.
bool getIsChunked | ( | ) | [protected, virtual] |
Determine whether the HTTP client should chunk the data Used for Transfer-Encoding header.
Implements IHTTPDataOut.
Definition at line 145 of file HTTPMap.cpp.
void put | ( | const char * | key, |
const char * | value | ||
) |
Put Key/Value pair The references to the parameters must remain valid as long as the clear() function is not called.
- Parameters:
-
key The key to use value The corresponding value
Definition at line 35 of file HTTPMap.cpp.
int read | ( | char * | buf, |
size_t | len, | ||
size_t * | pReadLen | ||
) | [protected, virtual] |
Read a piece of data to be transmitted.
- Parameters:
-
buf Pointer to the buffer on which to copy the data len Length of the buffer pReadLen Pointer to the variable on which the actual copied data length will be stored
Implements IHTTPDataOut.
Definition at line 57 of file HTTPMap.cpp.
void readReset | ( | ) | [protected, virtual] |
Reset stream to its beginning Called by the HTTPClient on each new request.
Implements IHTTPDataOut.
Definition at line 52 of file HTTPMap.cpp.
Generated on Tue Jul 12 2022 14:33:52 by 1.7.2