Objective
The previous article introduced the composer function, can simulate get and post requests, get request some are without parameters, this is relatively easy, directly put in the URL address bar on the line. Some get requests come with parameters, and this article details the URL address format.
First, the URL detailed
1.url is our usual open Baidu in the Address bar input: https:www.baidu.com, such as, this is the simplest URL address, opened the homepage of Baidu
2. Look at a slightly more complex URL, in the Baidu input box input: Shanghai leisurely Blog Park
3. Check the URL address bar, compared to the previous Baidu homepage URL address, a lot more parameters behind. Of course the main parameters are: wd= Shanghai leisurely Blog Park (behind a large string can be temporarily ignored).
4. So the question is, what is the effect of these parameters?
You can make a simple comparison by typing in the address bar, respectively:
Https:www.baidu.com
https://www.baidu.com/s?wd= Shanghai Leisurely Blog Park
Compare the open page what is different, now know the role of it, that is, this many "/s?" wd= Shanghai Leisurely Blog "is the search results page
Second, URL parsing
1. Take the URL request of "https://www.baidu.com/s?wd= Shanghai leisurely Blog Park" as an example
2. Then a complete URL address, the basic format is as follows:
https://host:port/path?xxx=aaa&ooo=bbb
--http/https: This is the protocol type, as shown in 1
--host: The IP address or domain name of the server, as shown in 2
The default port for the--port:http server is 80, in which case the lower number can be omitted.
If you use a different port, you must specify, for example: 192.168.3.111:8080, where 8080 is the port
--path: Access the path to the resource, as shown in 3/s (Figure 3 is to put the path and request parameters together)
--? : Inside the URL? This symbol is a split line that distinguishes between the path in front of the question mark and the parameter after the question mark
--url-params: The question mark is followed by the request parameter, format: xxx=aaa,4 area is the request parameter
--&: Multiple parameters with & sign connection
Third, request parameters (params)
1. The request parameter in the URL is generally called params, but the parameters we see in the Fiddler grab Kit are: QueryString
2.QueryString is a server-side commit parameter, in fact, with the params is a meaning, each parameter corresponding to the name and value values
3. A number of parameters are as follows
Four, UrlEncode code
1. If the URL address parameters are in Chinese, usually in the URL will be such, such as the 2nd wd=%e4%b8%8a%e6%b5%b7%e6% ...
Like see%e4 This encoding is through the URL encoded, need to decode to see what is the Chinese
2. Using UrlEncode Online encoding/decoding tool, Address: http://tool.chinaz.com/tools/urlencode.aspx
Fiddler grab packet 6-get request (URL details)