|
11 | 11 | namespace net = boost::network;
|
12 | 12 | namespace http = boost::network::http;
|
13 | 13 |
|
14 |
| - |
15 | 14 | BOOST_AUTO_TEST_CASE_TEMPLATE(http_client_get_test, T, tag_types) {
|
16 | 15 | typedef http::basic_client<T, 1, 0> client;
|
17 | 16 | typename client::request request("http://www.boost.org");
|
@@ -40,3 +39,27 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_get_test, T, tag_types) {
|
40 | 39 | BOOST_CHECK_EQUAL ( response_.status_message(), std::string("OK") );
|
41 | 40 | }
|
42 | 41 |
|
| 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