URL Username
Extract the username of an absolute URL using the WHATWG URL parser, including its normalization rules.
Description
URL user information precedes the host and can contain a username and password.
URL user information precedes the host and can contain a username and password. Extracted credentials remain serialized URL components, so percent encoding is different from the original human-readable credential.1
Extract the username of an absolute URL using the WHATWG URL parser, including its normalization rules.
When to use URL Username
Use this tool to extract the username of an absolute URL using the WHATWG URL parser, including its normalization rules.
Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
How to use URL Username and understand its results
- Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
- Enter url using the field table and calculation rules, then run the tool.
- Read username. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| url | Absolute URL to parse. | string; maximum length: 1000000 | Required |
Paste an absolute URL. The tool parses it without a base and returns the normalized username string, retaining percent escapes. An absent username yields an empty string; a malformed or relative URL is an input error.
username=WHATWG_URL(url).username Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| username | Normalized URL username. | string; maximum length: 1000000 |
{
"input": {
"url": "https://reader:secret@EXAMPLE.com:8443/a/../guide?q=one&q=two#part"
},
"output": {
"username": "reader"
}
} Limitations and assumptions
This does not decode credentials, authenticate or contact the endpoint. A credential in a URL does not establish that a server accepts it.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use URL Password: Extract the password of an absolute URL using the WHATWG URL parser, including its normalization rules. For a complementary task, use URL Host: Extract the host of an absolute URL using the WHATWG URL parser, including its normalization rules.
References
-
URL Username — tool.io
Similar or alternative tools
- URL Password
Extract the password of an absolute URL using the WHATWG URL parser, including its normalization rules.
- URL Host
Extract the host of an absolute URL using the WHATWG URL parser, including its normalization rules.