Query Parameters
- Query paramaeters are data sent from the client to the server.
- They area a list of "name" : "value" pairs.
- They are only relevant in a GET HTTP request.
- The "name"="value" pair is appended to the ? which is written after the URL.
- You can incude multiple pairs of name and value separated by a delimiter "&"
For example if in a form whose method is GET, if the form is submitted, the URL will look like this:
https://www.thwebdesk.blogspot.com/?name1=value1&name2=value2&name3=value3
If the value contains special charcaters that have a certain meaning in a context and encoded to %(2 digit hexadecimal number)
For example: If the name = "Gaurav" and value = "S'hirodkar"
The HTTP request URL will be https://www.thewebdesk.blogspot.com?name=Gaurav&value=S%3Ehirodkar
meaning that the sppecial character apostrophe has been converted to its ASCII code in Hexadecimal notation preceded by a % sign
The only exception to this rule is the space character
If the value contains spaces, they are encoded to + or %20.
For example, below both URLs are the same
For example, below both URLs are the same
- https://www.thewebdesk.blogspot.com/?name=Gaurav+Shirodkar
- https://www.thewebdesk.blogspot.com/?name=Gaurav%20Shirodkar
Since URL's are not case-sensitive abnd query parameters are the part of an URL the query parameret "name" are also not case-sensitive
For example below both URLs are the same
For example below both URLs are the same
- htttps://www.thewebdesk.blogspot.com/?name=Gaurav
- https://www.thewebdesk.blogspot.com/?Name=Gaurav
Comments
Post a Comment