URL: Uniform Resource Locator¶
https://en.m.wikipedia.org/wiki/URL
-
XX
(name, str, port)¶ Common URI scheme strings.
-
class
Url
¶ - #include <Url.h>
Class to manage URL instance.
- Note
- The various URL components are stored in un-escaped format for ease of editing. Unless otherwise indicated, methods act on un-escaped text. Methods used to obtain escaped versions are clearly marked. Any attached fragment (marked bv ‘#’) in the URL is discarded
Public Functions
-
Url
()¶
-
Url
(const String &urlString)¶ Construct a URL object from a regular escaped string.
- Parameters
urlString
: Escaped URL
-
Url
(const char *urlString)¶ Construct a URL object from a regular null-terminated escaped string.
- Parameters
urlString
: Escaped URL
-
Url
(const String &scheme, const String &user, const String &password, const String &host, int port = 0, const String &path = nullptr, const String &query = nullptr, const String &fragment = nullptr)¶
-
Url &
operator=
(String urlString)¶ Copy assignment operator.
- Note
- urlString is modified by so no point in passing const reference
- Parameters
urlString
: Escaped URL
-
Url &
operator=
(const char *urlString)¶ Copy assignment operator, for C-style strings.
- Parameters
urlString
: Escaped URL
-
operator String
() const¶
-
int
getPort
() const¶ Obtain the actual port number to be used.
- Note
- If not specified, the default scheme port is returned
- Return Value
int
:
-
String
getHostWithPort
() const¶ Get hostname+port part of URL string.
- Note
- Neither of these is subject to escaping
- Return Value
-
String
getPathWithQuery
() const¶ Get path with any query parameters attached.
- Note
- Both path and query values are escaped
- Return Value
-
void
debugPrintTo
(Print &p) const¶ Printable output for debugging.
- Parameters
p
: