File tree Expand file tree Collapse file tree 4 files changed +52
-5
lines changed
boost/network/protocol/http/impl Expand file tree Collapse file tree 4 files changed +52
-5
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ namespace http {
50
50
*/
51
51
template <class Tag >
52
52
struct basic_request : public basic_message <Tag> {
53
- mutable boost::network::uri::uri uri_;
53
+ boost::network::uri::uri uri_;
54
54
std::uint16_t source_port_;
55
55
typedef basic_message<Tag> base_type;
56
56
@@ -65,10 +65,6 @@ struct basic_request : public basic_message<Tag> {
65
65
explicit basic_request (boost::network::uri::uri const & uri_)
66
66
: uri_(uri_), source_port_(0 ) {}
67
67
68
- void uri (string_type const & new_uri) { uri_ = new_uri; }
69
-
70
- void uri (boost::network::uri::uri const & new_uri) { uri_ = new_uri; }
71
-
72
68
basic_request () : base_type(), source_port_(0 ) {}
73
69
74
70
basic_request (basic_request const & other)
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ if (OPENSSL_FOUND)
12
12
endif ()
13
13
14
14
if (Boost_FOUND )
15
+ add_subdirectory (client )
16
+
15
17
set (TESTS response_incremental_parser_test request_incremental_parser_test
16
18
request_linearize_test )
17
19
foreach ( test ${TESTS} )
Original file line number Diff line number Diff line change
1
+ # Copyright 2016 Glyn Matthews.
2
+ # Distributed under the Boost Software License, Version 1.0.
3
+ # (See accompanying file LICENSE_1_0.txt or copy at
4
+ # http://www.boost.org/LICENSE_1_0.txt)
5
+
6
+
7
+ set (
8
+ TESTS
9
+ request_test
10
+ )
11
+
12
+ foreach (test ${TESTS} )
13
+ set (test_name cpp-netlib-http-client-${test} )
14
+
15
+ add_executable (${test_name} ${test} .cpp )
16
+ add_dependencies (${test_name} cppnetlib-uri gtest_main )
17
+ target_link_libraries (${test_name}
18
+ ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri gtest_main )
19
+ set_target_properties (${test_name}
20
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/tests )
21
+ add_test (${test_name}
22
+ ${CPP-NETLIB_BINARY_DIR}/tests/${test_name} )
23
+
24
+ if (OPENSSL_FOUND )
25
+ target_link_libraries (${test_name} ${OPENSSL_LIBRARIES} )
26
+ endif ()
27
+
28
+ endforeach (test )
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 Glyn Matthews.
2
+ // Distributed under the Boost Software License, Version 1.0.
3
+ // (See accompanying file LICENSE_1_0.txt or copy at
4
+ // http://www.boost.org/LICENSE_1_0.txt)
5
+
6
+
7
+ #include < gtest/gtest.h>
8
+ // #include <boost/network/protocol/http/client/request.hpp>
9
+ #include < boost/network/protocol/http/client.hpp>
10
+
11
+
12
+ using client_request = boost::network::http::client::request;
13
+
14
+
15
+ TEST (http_client_request, construct_from_uri) {
16
+ ASSERT_NO_THROW (client_request (" http://cpp-netlib.org/" ));
17
+ }
18
+
19
+ TEST (http_client_request, construct_from_invalid_uri) {
20
+ ASSERT_THROW (client_request (" I am not a valid URI" ), std::exception);
21
+ }
You can’t perform that action at this time.
0 commit comments