File tree 1 file changed +4
-2
lines changed
boost/network/protocol/http/client
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,9 @@ namespace boost { namespace network { namespace http {
41
41
42
42
response const post (request request_, string_type const & content_type, string_type const & body_) {
43
43
request_ << ::boost::network::body (body_)
44
- << header (" Content-Type" , content_type)
45
44
<< header (" Content-Length" , boost::lexical_cast<string_type>(body_.size ()));
45
+ if (!boost::empty (headers (request_)[" Content-Type" ]))
46
+ request_ << header (" Content-Type" , content_type);
46
47
return post (request_);
47
48
}
48
49
@@ -60,8 +61,9 @@ namespace boost { namespace network { namespace http {
60
61
61
62
response const put (request request_, string_type const & content_type, string_type const & body_) {
62
63
request_ << ::boost::network::body (body_)
63
- << header (" Content-Type" , content_type)
64
64
<< header (" Content-Length" , boost::lexical_cast<string_type>(body_.size ()));
65
+ if (!boost::empty (headers (request_)[" Content-Type" ]))
66
+ request_ << header (" Content-Type" , content_type);
65
67
return put (request_);
66
68
}
67
69
You can’t perform that action at this time.
0 commit comments