Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
HttpText Class Reference
This is a basic TEXT/JSON/HTML/XML implementation of IHttpDataIn and IHttpDataOut to work with SecureHttpClient. More...
#include <HttpText.h>
Inherits IHttpDataIn, and IHttpDataOut.
Public Member Functions | |
| HttpText (char *) | |
| Create an HttpText instance for output. | |
| HttpText (char *str, size_t size) | |
| Create an HttpText instance for input. | |
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. | |
| virtual void | writeReset () |
| Reset stream to its beginning Called by the HTTPClient on each new request. | |
| virtual int | write (const char *buf, size_t len) |
| Write a piece of data transmitted by the server. | |
| virtual void | setDataType (const char *type) |
| Set MIME type. | |
| virtual void | setIsChunked (bool chunked) |
| Determine whether the data is chunked Recovered from Transfer-Encoding header. | |
| virtual void | setDataLen (size_t len) |
| If the data is not chunked, set its size From Content-Length header. | |
Detailed Description
This is a basic TEXT/JSON/HTML/XML implementation of IHttpDataIn and IHttpDataOut to work with SecureHttpClient.
Definition at line 35 of file HttpText.h.
Constructor & Destructor Documentation
| HttpText | ( | char * | str ) |
Create an HttpText instance for output.
- Parameters:
-
str String to be transmitted
Definition at line 41 of file HttpText.cpp.
| HttpText | ( | char * | str, |
| size_t | size | ||
| ) |
Create an HttpText instance for input.
- Parameters:
-
str Buffer to store the incoming string size Size of the buffer
Definition at line 48 of file HttpText.cpp.
Member Function Documentation
| size_t getDataLen | ( | ) | [protected, virtual] |
If the data is not chunked, get its size Used for Content-Length header.
Implements IHttpDataOut.
Definition at line 92 of file HttpText.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 80 of file HttpText.cpp.
| bool getIsChunked | ( | ) | [protected, virtual] |
Determine whether the HTTP client should chunk the data Used for Transfer-Encoding header.
Implements IHttpDataOut.
Definition at line 87 of file HttpText.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 72 of file HttpText.cpp.
| void readReset | ( | ) | [protected, virtual] |
Reset stream to its beginning Called by the HTTPClient on each new request.
Implements IHttpDataOut.
Definition at line 67 of file HttpText.cpp.
| void setDataLen | ( | size_t | len ) | [protected, virtual] |
If the data is not chunked, set its size From Content-Length header.
Implements IHttpDataIn.
Definition at line 122 of file HttpText.cpp.
| void setDataType | ( | const char * | type ) | [protected, virtual] |
Set MIME type.
- Parameters:
-
type Internet media type from Content-Type header
Implements IHttpDataIn.
Definition at line 112 of file HttpText.cpp.
| void setIsChunked | ( | bool | chunked ) | [protected, virtual] |
Determine whether the data is chunked Recovered from Transfer-Encoding header.
Implements IHttpDataIn.
Definition at line 117 of file HttpText.cpp.
| int write | ( | const char * | buf, |
| size_t | len | ||
| ) | [protected, virtual] |
Write a piece of data transmitted by the server.
- Parameters:
-
buf Pointer to the buffer from which to copy the data len Length of the buffer
Implements IHttpDataIn.
Definition at line 103 of file HttpText.cpp.
| void writeReset | ( | ) | [protected, virtual] |
Reset stream to its beginning Called by the HTTPClient on each new request.
Implements IHttpDataIn.
Definition at line 98 of file HttpText.cpp.
Generated on Tue Jul 12 2022 15:55:23 by
1.7.2