Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita623730

Browse files
committed
Fixes#35
Making calls to client.post and client.put smarter with the provided request objects.
1 parent18271fe commita623730

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎boost/network/protocol/http/client/facade.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ namespace boost { namespace network { namespace http {
5656

5757
responseconstpost (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);
6162
returnpost(request_);
6263
}
6364

@@ -75,8 +76,9 @@ namespace boost { namespace network { namespace http {
7576

7677
responseconstput (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);
8082
returnput(request_);
8183
}
8284

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp