Skip to content

Commit c565cec

Browse files
committed
Adding the optional HTTPS support.
1 parent d9e2dee commit c565cec

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
namespace net = boost::network;
1212
namespace http = 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::request request("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::request request("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::request request("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)