-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: http_client: Fix payload issue on HTTP upload
Bug fix and improved `payload` handling in `http_client_req`. Changes to `http_client_req` behaviour: If the user provides `payload_len` it is used to generate the `Content-Length` header. This is done even if `payload_cb` is used to provide the actual data. If no `payload_len` is specified then no `Content-Length` is generated. If `payload_cb` is provided it is called to send the payload data. Otherwise `payload` is used as the payload buffer and sent. If `payload_len` is not zero, it is used as the size of `payload`. Otherwise `payload` is assumed to be a string and `strlen` is used to determine its size. This is to maintain current behaviour and not break existing samples. Fixes #24431 Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
- Loading branch information
Showing
2 changed files
with
40 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters