This class contains all properties of a Url.
More...
#include "Url.h"
Inherits atscppapi::noncopyable.
This class contains all properties of a Url.
You can use a Url object to get and set any property of a url.
- Warning
- Url objects should never be constructed by the user. If a user needs to create an unbound Url then they should create a Request object using Request::Request(string) which will construct a Url object for them and it can be retrieved via Request::getUrl(). A full example of this is available in examples/detachedrequest/.
const std::string & Url::getHost |
( |
| ) |
const |
- Returns
- The host only of the url, this might be www.linkedin.com
const std::string & Url::getPath |
( |
| ) |
const |
- Returns
- The path only portion of the url, such as /profile/view
uint16_t Url::getPort |
( |
| ) |
const |
- Returns
- The port only portion of the url, this will likely be 80 or 443.
const std::string & Url::getQuery |
( |
| ) |
const |
- Returns
- The query only portion of the url, which might be id=1234
const std::string & Url::getScheme |
( |
| ) |
const |
- Returns
- The scheme of the url, this will be either http or https.
const std::string & Url::getUrlString |
( |
| ) |
const |
This method allows you to reset the url, this will force the Url to fully re-read all cached values. If this method is used on a Detached Requests' Url object it will completely destroy the values.
- Note
- This method should rarely be used.
void Url::setHost |
( |
const std::string & |
host | ) |
|
Set the host of the url
- Parameters
-
host | this might be something such as www.linkedin.com or www.apache.org |
void Url::setPath |
( |
const std::string & |
path | ) |
|
Set the path of the url.
- Parameters
-
path | the path portion of the url to set, this might be something like /foo/bar |
void Url::setPort |
( |
const uint16_t |
port | ) |
|
Set the port portion of the url.
- Parameters
-
port | this is a uint16_t which represents the port (in host order, there is no need to conver to network order). You might use a value such as 80 or 8080. |
void Url::setQuery |
( |
const std::string & |
query | ) |
|
Set the query param of the url.
- Parameters
-
query | the query portion of the url, this might be something like foo=bar&blah=baz. |
void Url::setScheme |
( |
const std::string & |
scheme | ) |
|
Set the scheme of the url
- Parameters
-
scheme | this might be either http or https. |
The documentation for this class was generated from the following files: