Releases: playmiel/ESPAsyncWebClient
Releases · playmiel/ESPAsyncWebClient
2.1.2
2.1.0
2.0.0
This pull request updates the API and documentation for the Async HTTP client library, introducing breaking changes for version 2. The main focus is on modernizing memory management, updating callback signatures to use smart pointers, and clarifying ownership semantics. The README and all example sketches are updated to reflect these changes, ensuring consistency and providing migration guidance.
API and Ownership Changes:
- The
SuccessCallbacksignature now takes astd::shared_ptr<AsyncHttpResponse>instead of a raw pointer, and all usages in examples and documentation are updated accordingly. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] - Advanced requests now require a
std::unique_ptr<AsyncHttpRequest>to transfer ownership to the client; all example usages and API documentation are updated to match. [1] [2] [3] [4] [5] - The README clarifies that response objects are managed via
shared_ptr, and request objects viaunique_ptr, with explicit notes about object lifetimes and the need to copy data if it must be retained after callbacks. [1] [2]
API Modernization and Migration:
- The migration section in the README lists all breaking changes from v1 to v2, including new callback signatures, changed return types (e.g.,
getBody()now returns by value), and the removal of legacy APIs. - All relevant method signatures in the documentation are updated to reflect new return types and parameter ownership (
get,post,putnow returnuint32_tand accept updated callback types). [1] [2]
Documentation and Example Consistency:
- All examples are updated to use modern C++ smart pointers for requests and responses, ensuring users follow best practices and avoid memory errors. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
- The README is revised throughout to match the new API, including callback signatures, memory management, and usage patterns. [1] [2] [3] [4]
Other improvements:
- Minor improvements to documentation clarity, such as notes about keep-alive pooling and chunk data validity. [1] [2]
- PlatformIO test configuration updated to use the correct dependency and include local library sources.
These changes modernize the library's API, improve safety and clarity, and provide clear migration guidance for users upgrading from v1 to v2.