|
2 | 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. |
3 | 3 |
|
4 | 4 | #include "stdafx.h" |
5 | | -#include "cpprest/http_client.h" |
| 5 | +#include "uri_builder.h" |
6 | 6 | #include "signalrclient/transport_type.h" |
7 | 7 |
|
8 | 8 | namespace signalr |
9 | 9 | { |
10 | 10 | namespace url_builder |
11 | 11 | { |
12 | | - web::uri_builder &convert_to_websocket_url(web::uri_builder &builder, transport_type transport) |
| 12 | + uri_builder &convert_to_websocket_url(uri_builder &builder, transport_type transport) |
13 | 13 | { |
14 | 14 | if (transport == transport_type::websockets) |
15 | 15 | { |
16 | | - if (builder.scheme() == _XPLATSTR("https")) |
| 16 | + if (builder.scheme() == "https") |
17 | 17 | { |
18 | | - builder.set_scheme(utility::conversions::to_string_t("wss")); |
| 18 | + builder.set_scheme("wss"); |
19 | 19 | } |
20 | 20 | else |
21 | 21 | { |
22 | | - builder.set_scheme(utility::conversions::to_string_t("ws")); |
| 22 | + builder.set_scheme("ws"); |
23 | 23 | } |
24 | 24 | } |
25 | 25 |
|
26 | 26 | return builder; |
27 | 27 | } |
28 | 28 |
|
29 | | - web::uri_builder build_uri(const std::string& base_url, const std::string& command, const std::string& query_string) |
| 29 | + uri_builder build_uri(const std::string& base_url, const std::string& command, const std::string& query_string) |
30 | 30 | { |
31 | | - web::uri_builder builder(utility::conversions::to_string_t(base_url)); |
32 | | - builder.append_path(utility::conversions::to_string_t(command)); |
33 | | - return builder.append_query(utility::conversions::to_string_t(query_string)); |
| 31 | + uri_builder builder(base_url); |
| 32 | + builder.append_path(command); |
| 33 | + return builder.append_query(query_string); |
34 | 34 | } |
35 | 35 |
|
36 | | - web::uri_builder build_uri(const std::string& base_url, const std::string& command) |
| 36 | + uri_builder build_uri(const std::string& base_url, const std::string& command) |
37 | 37 | { |
38 | | - web::uri_builder builder(utility::conversions::to_string_t(base_url)); |
39 | | - return builder.append_path(utility::conversions::to_string_t(command)); |
| 38 | + uri_builder builder(base_url); |
| 39 | + return builder.append_path(command); |
40 | 40 | } |
41 | 41 |
|
42 | 42 | std::string build_negotiate(const std::string& base_url) |
43 | 43 | { |
44 | | - return utility::conversions::to_utf8string(build_uri(base_url, "negotiate").to_string()); |
| 44 | + return build_uri(base_url, "negotiate").to_string(); |
45 | 45 | } |
46 | 46 |
|
47 | 47 | std::string build_connect(const std::string& base_url, transport_type transport, const std::string& query_string) |
48 | 48 | { |
49 | 49 | auto builder = build_uri(base_url, "", query_string); |
50 | | - return utility::conversions::to_utf8string(convert_to_websocket_url(builder, transport).to_string()); |
51 | | - } |
52 | | - |
53 | | - std::string build_start(const std::string& base_url, const std::string &query_string) |
54 | | - { |
55 | | - return utility::conversions::to_utf8string(build_uri(base_url, "", query_string).to_string()); |
| 50 | + return convert_to_websocket_url(builder, transport).to_string(); |
56 | 51 | } |
57 | 52 | } |
58 | 53 | } |
0 commit comments