What's the term for the part of the URL after the question mark?
22,030
Solution 1
It's the query, or sometimes the query string.
To pinch a useful diagram from the URI RFC:
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
Solution 2
It's called the "query string", as you can see on Wikipedia.
Solution 3
The query.
https://www.rfc-editor.org/rfc/rfc3986#section-3.4
Related videos on Youtube
Author by
Emanuil Rusev
Designer, developer, minimalist, maker of Nota, Historie, Parsedown.
Updated on October 02, 2021Comments
-
Emanuil Rusev over 2 years
http://www.example.com?foo
What's the term for the
foo
part of the URL? -
Sankalp Kotewar about 5 yearsIn the link mentioned in the question, 'example.com?foo' is it possible to have just foo and no assignment (like 'name=ferret' in your example)? If yes, that what would be foo's work over there?
-
Trect over 4 years@SankalpKotewar No, you cannot have that without a assignment. The query should have the form
field=value
. Check this[en.wikipedia.org/wiki/Query_string] -
Boris Verkhovskiy over 2 years@SankalpKotewar the convention is to have your query in this format:
?foo=bar&baz=qux
but nothing forces you to do that and the query can pretty much be any text (except it can't contain a#
). So yes, it's possible. http://example.com/????? is a valid URL for example.