62 static std::optional<Url>
parse(std::string_view text);
67 return u.has_value() && !u->scheme.empty();
92std::vector<std::pair<std::string, std::string>>
98 const std::vector<std::pair<std::string, std::string>>& params);
Definition generated_event_source.hpp:33
std::string form_encode(std::string_view s)
application/x-www-form-urlencoded style — space → +, then percent-encode everything else.
std::string percent_decode(std::string_view s)
Decode percent-escapes — %20 → space, %2F → /.
std::string form_decode(std::string_view s)
Reverse of form_encode. + decodes to space.
std::string percent_encode(std::string_view s)
Percent-encode s per RFC 3986 — unreserved characters (A-Z a-z 0-9 - _ .
std::string build_query(const std::vector< std::pair< std::string, std::string > > ¶ms)
Build a query string from key/value pairs.
std::vector< std::pair< std::string, std::string > > parse_query(std::string_view query)
Parse a URL query string into key/value pairs.
Parsed URL components.
Definition url.hpp:30
std::string to_string() const
Serialize back to text form.
uint16_t port
Definition url.hpp:35
bool empty() const
True when all components are empty / default.
Definition url.hpp:41
std::string password
Definition url.hpp:33
std::string user
Definition url.hpp:32
std::string scheme
Definition url.hpp:31
std::string path
Definition url.hpp:36
uint16_t effective_port() const
Effective port — port if non-zero, otherwise default_port().
Definition url.hpp:51
static std::optional< Url > parse(std::string_view text)
Parse a URL string.
std::string query
Definition url.hpp:37
uint16_t default_port() const
Default port for the scheme — e.g.
static bool is_valid(std::string_view text)
True if text parses as a URL with at least a scheme.
Definition url.hpp:65
std::string fragment
Definition url.hpp:38
std::string host
Definition url.hpp:34