mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-18 10:48:28 +00:00
fix #110
This commit is contained in:
parent
5ad4311fb0
commit
86b3dfc480
2 changed files with 21 additions and 6 deletions
|
@ -2068,12 +2068,7 @@ inline void Client::write_request(Stream& strm, Request& req)
|
|||
|
||||
// Body
|
||||
if (!req.body.empty()) {
|
||||
if (req.get_header_value("Content-Type") == "application/x-www-form-urlencoded") {
|
||||
auto str = detail::encode_url(req.body);
|
||||
bstrm.write(str.c_str(), str.size());
|
||||
} else {
|
||||
bstrm.write(req.body.c_str(), req.body.size());
|
||||
}
|
||||
bstrm.write(req.body.c_str(), req.body.size());
|
||||
}
|
||||
|
||||
// Flush buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue