Merge branch 'fix/chunk_encoded_post_request_failed' into 'master'

fix(esp_http_client): implement chunked transfer encoding in before tranport write

Closes IDFGH-16566

See merge request espressif/esp-idf!44362
This commit is contained in:
Mahavir Jain
2026-04-23 14:02:41 +05:30
6 changed files with 288 additions and 8 deletions
@@ -81,8 +81,10 @@ Some applications need to open the connection and control the exchange of data a
* :cpp:func:`esp_http_client_init`: Create a HTTP client handle.
* ``esp_http_client_set_*`` or ``esp_http_client_delete_*``: Modify the HTTP connection parameters (optional).
* :cpp:func:`esp_http_client_open`: Open the HTTP connection with ``write_len`` parameter (content length that needs to be written to server), set ``write_len=0`` for read-only connection.
* :cpp:func:`esp_http_client_open`: Open the HTTP connection with ``write_len`` parameter (content length that needs to be written to server), set ``write_len=0`` for read-only connection and set ``write_len=-1`` for chunked encoded data transfer.
* :cpp:func:`esp_http_client_write`: Write data to server with a maximum length equal to ``write_len`` of :cpp:func:`esp_http_client_open` function; no need to call this function for ``write_len=0``.
* :cpp:func:`esp_http_client_chunk_write_begin`: Begin a chunk by sending the chunk header (size line) when using chunked transfer encoding (``write_len=-1``).
* :cpp:func:`esp_http_client_chunk_write_end`: End a chunk by sending the chunk trailer when using chunked transfer encoding.
* :cpp:func:`esp_http_client_fetch_headers`: Read the HTTP Server response headers, after sending the request headers and server data (if any). Returns the ``content-length`` from the server and can be succeeded by :cpp:func:`esp_http_client_get_status_code` for getting the HTTP status of the connection.
* :cpp:func:`esp_http_client_read`: Read the HTTP stream.
* :cpp:func:`esp_http_client_close`: Close the connection.