HTTP and HTTPS library for Mbed OS 5
Dependents: RZ_A2M_Mbed_samples_20201012 RZ_A2M_Mbed_samples
Diff: source/http_request_builder.h
- Branch:
- tlssocket
- Revision:
- 31:b3730a2c4f39
- Parent:
- 26:fe4e03a404fb
- Child:
- 32:fa4d71265625
--- a/source/http_request_builder.h Tue Mar 27 11:07:02 2018 +0200 +++ b/source/http_request_builder.h Tue Oct 30 10:18:51 2018 +0800 @@ -58,15 +58,16 @@ } } - char* build(const void* body, size_t body_size, size_t &size, bool skip_content_length = false) { + char* build(const void* body, uint32_t body_size, uint32_t &size, bool skip_content_length = false) { const char* method_str = http_method_str(method); bool is_chunked = has_header("Transfer-Encoding", "chunked"); if (!is_chunked && (method == HTTP_POST || method == HTTP_PUT || method == HTTP_DELETE || body_size > 0)) { char buffer[10]; - snprintf(buffer, 10, "%d", body_size); + snprintf(buffer, 10, "%lu", body_size); set_header("Content-Length", string(buffer)); + printf("header Content-Length: %s\n", buffer); } size = 0;