web123456

What is x-www-form-urlencoded

Overview:
x-www-form-urlencoded paper translation is the so-called url format encoding, which is the default Content-Type of post. In fact, I think it is believed that the default form data transmission formats of get and post are the same, just add one after the url address? Add the form data, and the other is to write the form data in the request body

1. Location:
In the Content-Type field in the request header,
2. Writing method:
Content-Type:application/x-www-form-urlencoded

3. Uses:
What is the request body format for get request? The get request is spliced ​​after the url. Generally, username=tom&pwd=123 is used. This format is called query parameters. x-www-form-urlencoded also looks like this, but it is not added after the url;
You should know that the default data transmission format of post is x-www-form-urlencoded, so why do you need to convert the data into url format when posting data (username=tom&pwd=123). Generally, using the () method of the qs library, you can convert the json object into url format encoding (x-www-form-urlencoded).