@@ -56,8 +56,9 @@ namespace boost { namespace network { namespace http {
5656
5757 responseconst post (request request_, string_typeconst & content_type, string_typeconst & body_) {
5858 request_ << ::boost::network::body (body_)
59- <<header (" Content-Type" , content_type)
6059 <<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);
6162return post (request_);
6263 }
6364
@@ -75,8 +76,9 @@ namespace boost { namespace network { namespace http {
7576
7677 responseconst put (request request_, string_typeconst & content_type, string_typeconst & body_) {
7778 request_ << ::boost::network::body (body_)
78- <<header (" Content-Type" , content_type)
7979 <<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);
8082return put (request_);
8183 }
8284