mark
mark

Reputation: 62746

Is it valid for an HTTP URL query argument to contain a single value without any value name?

I have inherited the following URL template from our old RESTful (supposedly) service:

http://{host}:{port}/{handle}?{extraQualifier}

For instance:

Yields the following URL:

http://localhost:8182/abc?yabaDabaDoo

Is such URL template valid with respect to the http URL specification? I failed to find the definitive answer browsing through various RFCs, but I could miss something important.

Thanks.

Upvotes: 0

Views: 114

Answers (2)

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81684

The format of the query string is unspecified in HTTP. Although encoded form contents are a very common usage, it's not the only usage. The contents of the query string is entirely up to the server-side code to interpret.

Upvotes: 1

Sebastian
Sebastian

Reputation: 8164

From RFC1738 section 3.3 HTTP this is perfectly valid. There aren't any specific restrictions for <path> ({handle} in your case).

From RFC:

http://<host>:<port>/<path>?<searchpart>

Edit

Within RFC2616 this is defined in section 3.2.2:

http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]

Upvotes: 1

Related Questions