You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-10Lines changed: 34 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
An asynchronous HTTP client library for ESP32 microcontrollers, built on top of AsyncTCP. This library provides a simple and efficient way to make HTTP requests without blocking your main program execution.
9
9
10
-
> 🔐 **HTTPS Ready**: TLS/HTTPS is available via AsyncTCP + mbedTLS. Load a CA certificate or fingerprint before talking to real servers, or call `client.setTlsInsecure(true)`only for testing. See the *HTTPS / TLS configuration* section below.
10
+
> 🔐 **HTTPS Ready**: TLS/HTTPS is available via AsyncTCP + mbedTLS. Load a CA certificate or fingerprint before talking to real servers. `client.setTlsInsecure(true)`is intended for debug/pinning scenarios; fully insecure TLS requires an explicit build-time opt-in (see the *HTTPS / TLS configuration* section below).
- 301/302/303 responses switch to `GET` automatically (body dropped).
306
320
- 307/308 keep the original method and body (stream bodies cannot be replayed automatically).
307
-
- Sensitive headers (`Authorization`, `Proxy-Authorization`) are stripped when the redirect crosses hosts.
321
+
- Cross-origin redirects default to forwarding only a small safe set of headers (e.g. `User-Agent`, `Accept`, etc.).
322
+
Use `setRedirectHeaderPolicy(...)` and `addRedirectSafeHeader(...)` if you need to forward additional headers.
308
323
- Redirects are triggered as soon as the headers arrive; the client skips downloading any subsequent 3xx body data.
309
324
310
325
See `examples/arduino/NoStoreToSD/NoStoreToSD.ino` for a full download example using `setNoStoreBody(true)` and a global `onBodyChunk` handler that streams chunked and non-chunked responses to an SD card.
@@ -409,9 +424,11 @@ Highlights / limitations:
409
424
410
425
`https://` URLs now use the built-in AsyncTCP + mbedTLS transport. Supply trust material before making real requests:
411
426
412
-
-`client.setTlsCACert(caPem)` — load a PEM CA chain (null-terminated). Mandatory unless using fingerprint pinning or `setTlsInsecure(true)`.
427
+
-`client.setTlsCACert(caPem)` — load a PEM CA chain (null-terminated). Mandatory unless using fingerprint pinning (see `setTlsFingerprint(...)`).
- Soft response buffering guard (`setMaxBodySize`) to fail fast on oversized payloads
@@ -569,11 +587,17 @@ Contributions are welcome! Please feel free to submit a Pull Request.
569
587
570
588
### Gzip / Compression
571
589
572
-
Current: only the `Accept-Encoding: gzip` header can be added via `enableGzipAcceptEncoding(true)`.
573
-
The library DOES NOT yet decompress gzip payloads. If you don't want compressed responses, simply don't enable the header.
590
+
Default: only the `Accept-Encoding: gzip` header can be added via `enableGzipAcceptEncoding(true)`.
591
+
592
+
Optional decode: build with `-DASYNC_HTTP_ENABLE_GZIP_DECODE=1` to transparently inflate `Content-Encoding: gzip` responses (both in-memory body and `client.onBodyChunk(...)` stream).
593
+
594
+
Notes:
574
595
575
-
Important: calling `enableGzipAcceptEncoding(false)` does not remove the header if it was already added earlier on the same request instance. Create a new request without enabling it to avoid sending the header.
576
-
A future optional flag (`ASYNC_HTTP_ENABLE_GZIP_DECODE`) may add a tiny inflater (miniz/zlib) after flash/RAM impact is evaluated.
596
+
- If you don't want compressed responses, simply don't enable the header.
597
+
-`enableGzipAcceptEncoding(false)` removes `Accept-Encoding` from the request's header list (or call `request.removeHeader("Accept-Encoding")`).
598
+
-`Content-Length` (when present) refers to the *compressed* payload size; completion detection still follows the wire length.
599
+
- RAM impact: enabling gzip decode allocates an internal 32KB sliding window per active gzip-decoded response (plus small state).
600
+
- Integrity: the gzip trailer is verified (CRC32 + ISIZE); corrupted payloads raise `GZIP_DECODE_FAILED`.
0 commit comments