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

Commitc565cec

Browse files
committed
Adding the optional HTTPS support.
1 parentd9e2dee commitc565cec

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

‎libs/network/test/http/client_get_test.cpp‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
namespacenet= boost::network;
1212
namespacehttp= boost::network::http;
1313

14-
1514
BOOST_AUTO_TEST_CASE_TEMPLATE(http_client_get_test, T, tag_types) {
1615
typedef http::basic_client<T,1,0> client;
1716
typename client::requestrequest("http://www.boost.org");
@@ -40,3 +39,27 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_test, T, tag_types) {
4039
BOOST_CHECK_EQUAL ( response_.status_message(),std::string("OK") );
4140
}
4241

42+
#ifdef BOOST_NETWORK_ENABLE_HTTPS
43+
44+
BOOST_AUTO_TEST_CASE_TEMPLATE(https_get_test_1_0, T, tag_types) {
45+
typedef http::basic_client<T,1,0> client;
46+
typename client::requestrequest("https://www.google.com/");
47+
client client_;
48+
typename client::response response_ = client_.get(request);
49+
typename net::headers_range<typename http::basic_response<T> >::type range =headers(response_)["Content-Type"];
50+
BOOST_CHECK (boost::begin(range) !=boost::end(range) );
51+
BOOST_CHECK (body(response_).size() !=0 );
52+
}
53+
54+
BOOST_AUTO_TEST_CASE_TEMPLATE(https_get_test_1_1, T, tag_types) {
55+
typedef http::basic_client<T,1,1> client;
56+
typename client::requestrequest("https://www.google.com/");
57+
client client_;
58+
typename client::response response_ = client_.get(request);
59+
typename net::headers_range<typename http::basic_response<T> >::type range =headers(response_)["Content-Type"];
60+
BOOST_CHECK (boost::begin(range) !=boost::end(range) );
61+
BOOST_CHECK (body(response_).size() !=0 );
62+
}
63+
64+
#endif
65+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp