Builds and parses URLs.
More...
#include <Url.h>
|
|
using | HostAndRest = std::pair< std::string, std::string > |
| | Represents the host part and rest of full URL.
|
| |
|
| static std::string | Decode (const std::string &in) |
| | Decodes a URL on a given input string by replacing percent-encoded characters with actual ones.
|
| |
| static std::string | Encode (const std::string &in) |
| | Encodes a given input string by escaping non-ASCII characters.
|
| |
| static std::string | Construct (const std::string &base, const std::string &path, const std::multimap< std::string, std::string > &query_params) |
| | Produces a full URL from a URL base, path, and query parameters.
|
| |
| static porting::optional< HostAndRest > | ParseHostAndRest (const std::string &url) |
| | Separates full URL to the host part the rest. Helps to split URL from credentials to parts passed to the OlpClient and NetworkRequest.
|
| |
◆ Construct()
| static std::string olp::utils::Url::Construct |
( |
const std::string & |
base, |
|
|
const std::string & |
path, |
|
|
const std::multimap< std::string, std::string > & |
query_params |
|
) |
| |
|
static |
Produces a full URL from a URL base, path, and query parameters.
- Parameters
-
| base | The base of the URL. |
| path | The path part of the URL. |
| query_params | The multimap of query parameters. |
- Returns
- The URL-encoded result string.
◆ Decode()
| static std::string olp::utils::Url::Decode |
( |
const std::string & |
in | ) |
|
|
static |
Decodes a URL on a given input string by replacing percent-encoded characters with actual ones.
- Parameters
-
| in | The URL-encoded string. |
- Returns
- The URL-decoded result string.
◆ Encode()
| static std::string olp::utils::Url::Encode |
( |
const std::string & |
in | ) |
|
|
static |
Encodes a given input string by escaping non-ASCII characters.
- Parameters
-
| in | The URL string to be encoded. |
- Returns
- The URL-encoded result string.
◆ ParseHostAndRest()
| static porting::optional< HostAndRest > olp::utils::Url::ParseHostAndRest |
( |
const std::string & |
url | ) |
|
|
static |
Separates full URL to the host part the rest. Helps to split URL from credentials to parts passed to the OlpClient and NetworkRequest.
- Parameters
-
- Returns
- An optional pair representing host part and the rest of URL. Returns olp::porting::none when url cannot be split.
The documentation for this class was generated from the following file:
- olp-cpp-sdk-core/include/olp/core/utils/Url.h