Description
Distinguish an absent query from an explicitly present empty query in a valid absolute HTTP(S) URL, preserving lexical question marks before the fragment.
Web protocol data has several layers: a complete message or URL, individual fields or components, and the literal tokens within them. Delimiter presence, spelling, comparison rules, and parser normalization can affect results. A check of one component needs its stated scope before it can be used in a larger parser or policy decision.
Distinguish an absent query from an explicitly present empty query in a valid absolute HTTP(S) URL, preserving lexical question marks before the fragment.
When to use this tool
Use Web: URL Empty Query Vs Absent Label when you need one stated URL, header, or protocol-component check in a diagnostic or parser workflow. Supply the input level specified below.
How to use the tool and how it works
- Enter urlText. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Parse urlText with the tool's URL parser and require HTTP or HTTPS. Inspect the original text before its first hash for a question mark, returning queryPresent and whether that marker ends the pre-fragment text as emptyQuery inside result.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| urlText | Url Text | Required. Text. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
{
"input": {
"urlText": "https://example.test/?#x"
},
"output": {
"result": {
"queryPresent": true,
"emptyQuery": true
}
}
} Limitations and assumptions
- Presence is measured from the supplied spelling rather than a normalized URL's query property. A question mark occurring only in a fragment is ignored, and no query parameter decoding is performed.
- Outputs are nested inside result. The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Use a complete URL or header parser when the task involves an entire field or message. Test actual browser, server, or cache behavior separately when a security or protocol decision depends on more than this component.
References
Similar or alternative tools
- URL Fragment Empty Marker
Find the first literal hash in url.
- parse/url
Split an absolute hierarchical URL into protocol, host, port, path, query, and fragment components. Bracketed IPv6 hosts and user-info prefixes are supported.