@@ -41,8 +41,9 @@ namespace boost { namespace network { namespace http {
4141
4242 responseconst post (request request_, string_typeconst & content_type, string_typeconst & body_) {
4343 request_ << ::boost::network::body (body_)
44- <<header (" Content-Type" , content_type)
4544 <<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);
4647return post (request_);
4748 }
4849
@@ -60,8 +61,9 @@ namespace boost { namespace network { namespace http {
6061
6162 responseconst put (request request_, string_typeconst & content_type, string_typeconst & body_) {
6263 request_ << ::boost::network::body (body_)
63- <<header (" Content-Type" , content_type)
6464 <<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);
6567return put (request_);
6668 }
6769