mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 17:28:29 +00:00
Fix #685
This commit is contained in:
parent
143b2dd15a
commit
09fdf4eacd
1 changed files with 5 additions and 2 deletions
|
@ -4881,8 +4881,11 @@ inline bool ClientImpl::write_request(Stream &strm, const Request &req,
|
||||||
auto length = std::to_string(req.content_length);
|
auto length = std::to_string(req.content_length);
|
||||||
headers.emplace("Content-Length", length);
|
headers.emplace("Content-Length", length);
|
||||||
} else {
|
} else {
|
||||||
|
if (req.method == "POST" || req.method == "PUT" ||
|
||||||
|
req.method == "PATCH") {
|
||||||
headers.emplace("Content-Length", "0");
|
headers.emplace("Content-Length", "0");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!req.has_header("Content-Type")) {
|
if (!req.has_header("Content-Type")) {
|
||||||
headers.emplace("Content-Type", "text/plain");
|
headers.emplace("Content-Type", "text/plain");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue