Skip to content

Commit 8cb6c99

Browse files
committed
Added uri constructor to http::request.
1 parent b86fa8c commit 8cb6c99

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

boost/network/protocol/http/impl/request.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,18 @@ namespace http {
6363
: uri_(uri_)
6464
{ }
6565

66+
explicit basic_request(boost::network::uri::uri const & uri_)
67+
: uri_(uri_)
68+
{ }
69+
6670
void uri(string_type const & new_uri) {
6771
uri_ = new_uri;
6872
}
6973

74+
void uri(boost::network::uri::uri const & new_uri) {
75+
uri_ = new_uri;
76+
}
77+
7078
basic_request()
7179
: base_type()
7280
{ }

libs/network/example/twitter/search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main(int argc, char * argv[]) {
3131
std::cout << "Searching Twitter for query: " << argv[1] << std::endl;
3232
uri::uri search_1;
3333
search_1 << search_uri << uri::query("q", uri::encoded(argv[1]));
34-
http::client::request request(search_1.string());
34+
http::client::request request(search_1);
3535
http::client::response response = client.get(request);
3636

3737
std::cout << body(response) << std::endl;

0 commit comments

Comments
 (0)