Alex Rivera | Logout

What's the term for the part of the URL after the question mark?

Asked 2010-10-24T09:52:59.910
57

http://www.example.com?foo

What's the term for the foo part of the URL?

Edit
Report

3 Answers

128

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
answered 2010-10-24T09:58:21.290
6
answered 2010-10-24T09:54:46.647
2

Depends on the technology you use. Usually its called name value pair. Query string refers to the whole string after ? sign. Then depending on technology used that query string is parsed and normally appears as the dictionary. For example, http://www.example.com?foo=bar&foo1=bar1: Request["foo"] yields "bar" Request["foo1"] yields "bar1" for asp or $_GET["foo"] -> "bar" for php and so on.

answered 2010-10-24T10:01:56.240

Your Answer