Several parameters in http get request

Are the URLs of the form http://asdf.com/something.do?param1=true?param2=false valid?

I do not think the second? allowed in valid urls and that it should be an ampersand (&) instead, but I can't find anything about it in http 1.1 rfc. Any ideas?

+6
uri query-string
source share
4 answers

Can not use? again.? should indicate the beginning of the parameter list. and must separate the parameters.

From RFC 3986 :

URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] 

From RFC 1738 :

The HTTP URL takes the form:

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

where <host> and <port> are as described in section 3.1. If :<port> , the default port is 80. There is no username or password. allowed. <path> is the HTTP selector, and <searchpart> is the query string. <path> is optional, like <searchpart> and its preceding "?". If neither <path> nor <searchpart> , "/" may also be omitted.

In the <path> and <searchpart> , "/", ";", "?" are reserved. The character "/" can be used in HTTP to denote a hierarchical structure.

Part of the search / query part is described here.

+7
source
+4
source

application / x-www-form-urlencoded

This is the default content type. Forms submitted with this type of content should be encoded as follows:

  • Control names and values โ€‹โ€‹are escaped. Space characters are replaced by + , and then the reserved characters are escaped as described in [RFC1738], section 2.2: Instead of alphanumeric characters, the %HH character, percent sign and two hexadecimal digits representing the ASCII character code are replaced. Line breaks are represented as pairs " CR LF "(i.e., %0D%0A ).
  • The management names / values โ€‹โ€‹are listed in the order in which they appear in the document. The name is separated from the value = , and the name / value pairs are separated by & .

- application / x-www-form-urlencoded

+1
source

As already mentioned, this is not valid for reuse. However, if you have? character as part of the parameter value, you can encode it as% 63 (just like a space character that is encoded as% 20).

0
source

All Articles