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 @@ -56,8 +56,9 @@ namespace boost { namespace network { namespace http {
56
56
57
57
response const post (request request_, string_type const & content_type, string_type const & body_) {
58
58
request_ << ::boost::network::body (body_)
59
- << header (" Content-Type" , content_type)
60
59
<< header (" Content-Length" , boost::lexical_cast<string_type>(body_.size ()));
60
+ if (!boost::empty (headers (request_)[" Content-Type" ]))
61
+ request_ << header (" Content-Type" , content_type);
61
62
return post (request_);
62
63
}
63
64
@@ -75,8 +76,9 @@ namespace boost { namespace network { namespace http {
75
76
76
77
response const put (request request_, string_type const & content_type, string_type const & body_) {
77
78
request_ << ::boost::network::body (body_)
78
- << header (" Content-Type" , content_type)
79
79
<< header (" Content-Length" , boost::lexical_cast<string_type>(body_.size ()));
80
+ if (!boost::empty (headers (request_)[" Content-Type" ]))
81
+ request_ << header (" Content-Type" , content_type);
80
82
return put (request_);
81
83
}
82
84
You can’t perform that action at this time.
0 commit comments