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

Commite82051e

Browse files
committed
Explicitly add a "Connection: close" header to the request in the example.
1 parentfebd74e commite82051e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎contrib/http_examples/http/hello_world_client.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ int main(int argc, char* argv[]) {
2323
return1;
2424
}
2525

26+
/*<< Creates the client. >>*/
27+
http::client client;
28+
2629
try {
27-
/*<< Creates the client. >>*/
28-
http::client client;
2930
/*<< Creates a request using a URI supplied on the command
3031
line. >>*/
3132
http::client::requestrequest(argv[1]);
33+
/*<< Explicitly set a Connection: close header to the
34+
request. >>*/
35+
request <<network::header("Connection","close");
3236
/*<< Gets a response from the HTTP server. >>*/
3337
http::client::response response = client.get(request);
3438
/*<< Prints the response body to the console. >>*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp