14 uri.erase(uri.find_last_not_of(
'/') + 1u);
16 return network::uri(uri);
19 network::uri
MakeServiceUri(std::string base_uri, std::string_view service_path) {
21 base_uri.erase(base_uri.find_last_not_of(
'/') + 1u);
23 service_path.remove_prefix(std::min(service_path.find_first_not_of(
'/'),
24 service_path.size()));
25 if (base_uri.empty()) {
26 throw std::invalid_argument(
"base_uri argument is empty after stripping trailing slashes");
28 if (service_path.empty()) {
29 throw std::invalid_argument(
"service_path argument is empty after stripping leading "
33 base_uri.append(1u,
'/');
34 base_uri.append(service_path);
35 return network::uri(base_uri);
network::uri MakeServerUri(std::string uri)
Creates a server URI.
network::uri MakeServiceUri(std::string base_uri, std::string_view service_path)
Creates a service URI of the form <baseuri>/<service>.
Contains URI support functions for daqif.