Methods similar in format and usage to XmlHTTPrequest in Javascript.
Supports
GET, POST, PUT, PATCH, DELETE and HEAD
Request and response headers
Chunked response
Single String response for short (<~5K) responses (heap permitting).
Optional onData callback.
Optional onReadyStatechange callback.
Principles of operation
This library adds a simple HTTPS layer on top of the AsyncTCP_SSL library to facilitate REST communication from a Client to a Server. The paradigm is similar to the XMLHttpRequest in Javascript, employing the notion of a ready-state progression through the transaction request.
Synchronization can be accomplished using callbacks on ready-state change, a callback on data receipt, or simply polling for ready-state change. Data retrieval can be incremental as received, or bulk retrieved when the transaction completes provided there is enough heap to buffer the entire response.
The underlying buffering uses a new xbuf class. It handles both character and binary data. Class xbuf uses a chain of small (64 byte) segments that are allocated and added to the tail as data is added and deallocated from the head as data is read, achieving the same result as a dynamic circular buffer limited only by the size of heap. The xbuf implements indexOf and readUntil functions.
For short transactions, buffer space should not be an issue. In fact, it can be more economical than other methods that use larger fixed length buffers. Data is acked when retrieved by the caller, so there is some limited flow control to limit heap usage for larger transfers.
Request and response headers are handled in the typical fashion.
Chunked responses are recognized and handled transparently.
Following is the debug terminal when running example AsyncHTTPSRequest_ESP on ESP32_DEV to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library.
Add support to ESP32-based WT32_ETH01 using LAN8720 using either ESP32 core v1.0.6- or core v2.0.0+
Add example for WT32_ETH01
Debug Terminal Output Samples
1. AsyncHTTPSRequest_WT32_ETH01 on WT32_ETH01 using ESP32 core v2.0.0
Following is the debug terminal when running example AsyncHTTPSRequest_WT32_ETH01 on WT32_ETH01 to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library and ESP32 core v2.0.0
2. AsyncHTTPSRequest_WT32_ETH01 on WT32_ETH01 using ESP32 core v1.0.6
Following is the debug terminal when running example AsyncHTTPSRequest_WT32_ETH01 on WT32_ETH01 to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library and ESP32 core v1.0.6