Parse a URL into the protocol, host, path and query parts.
More...
#include <url_impl.h>
|
using | kvp_map_t = std::map<std::string, std::vector<std::string>> |
|
Parse a URL into the protocol, host, path and query parts.
- Note
- This class also manages time and time-based expiration using KVP info that AWS puts in the query string of the URL.
Definition at line 44 of file url_impl.h.
◆ kvp_map_t
using http::url::kvp_map_t = std::map<std::string, std::vector<std::string>> |
◆ url() [1/3]
http::url::url |
( |
std::string | url_s, |
|
|
bool | trusted = false ) |
|
inlineexplicit |
◆ url() [2/3]
http::url::url |
( |
const std::shared_ptr< http::url > & | source_url | ) |
|
|
inlineexplicit |
◆ url() [3/3]
http::url::url |
( |
const std::shared_ptr< http::url > & | source_url, |
|
|
bool | trusted ) |
|
inline |
◆ dump()
Returns a string representation of the URL and its bits.
- Returns
- the representation mentioned above.
Reimplemented in http::EffectiveUrl.
Definition at line 295 of file url_impl.cc.
◆ host()
virtual std::string http::url::host |
( |
| ) |
const |
|
inlinevirtual |
◆ ingest_time()
virtual std::time_t http::url::ingest_time |
( |
| ) |
const |
|
inlinevirtual |
◆ is_expired()
bool http::url::is_expired |
( |
| ) |
|
|
virtual |
- Returns
- True if the URL appears within the REFRESH_THRESHOLD of the expires time read from one of CLOUDFRONT_EXPIRES_HEADER_KEY or AMS_EXPIRES_HEADER_KEY.
Reimplemented in http::EffectiveUrl.
Definition at line 212 of file url_impl.cc.
◆ is_trusted()
virtual bool http::url::is_trusted |
( |
| ) |
const |
|
inlinevirtual |
◆ path()
virtual std::string http::url::path |
( |
| ) |
const |
|
inlinevirtual |
◆ protocol()
virtual std::string http::url::protocol |
( |
| ) |
const |
|
inlinevirtual |
◆ query()
virtual std::string http::url::query |
( |
| ) |
const |
|
inlinevirtual |
◆ query_parameter_value()
string http::url::query_parameter_value |
( |
const std::string & | key | ) |
const |
|
virtual |
Get the value of a query string key.
- Parameters
-
key | Key for the KVP query params |
- Returns
- The associated value for the key or an empty string if the key is not found.
Definition at line 167 of file url_impl.cc.
◆ query_parameter_values()
const vector< string > & http::url::query_parameter_values |
( |
const std::string & | key | ) |
const |
|
virtual |
Get the vector of query string values for a given key.
- Parameters
-
key | Key for the KVP query params |
- Returns
- Return a const reference to a string of values. Throws BESInternalError if the key is not found.
- See also
- query_parameter_values_size() to test if the key is present.
Definition at line 198 of file url_impl.cc.
◆ query_parameter_values_size()
size_t http::url::query_parameter_values_size |
( |
const std::string & | key | ) |
const |
|
virtual |
Return the number of query string values for a given key .
- Parameters
-
key | Key for the KVP query params |
- Returns
- Return the number of values or zero if the key is not found.
Definition at line 183 of file url_impl.cc.
◆ set_ingest_time()
virtual void http::url::set_ingest_time |
( |
const std::time_t & | itime | ) |
|
|
inlinevirtual |
◆ str()
virtual std::string http::url::str |
( |
| ) |
const |
|
inlinevirtual |
◆ HttpUrlTest
The documentation for this class was generated from the following files: