Fiddler grab Packet 7-post request (JSON)

Source: Internet
Author: User

Preface to the previous article about get request parameters are in the URL, the POST request is more than a GET request a body part, this article explains in detail the body part of the parameters of several forms.

First, the Body data type

There are four common types of post submission data:

1. The first type: Application/json: This is the most common JSON format and is also very friendly by small partners like one of the following

{"INPUT1": "xxx", "Input2": "Ooo", "Remember": false}

2. The second type: application/x-www-form-urlencoded: The native form form of the browser, and if you do not set the Enctype property, you will end up with application/x-www-form-urlencoded Way Commit Number

Input1=xxx&input2=ooo&remember=false

3. Third type: Multipart/form-data: This is a form format, the data type is as follows

------Webkitformboundaryrgkcby7qhfd3trwacontent-disposition:form-data; Name= "text" title------Webkitformboundaryrgkcby7qhfd3trwacontent-disposition:form-data; Name= "File"; Filename= "Chrome.png" Content-type:image/pngpng ... Content of chrome.png ...------ webkitformboundaryrgkcby7qhfd3trwa--

4. Fourth type: Text/xml: This direct-pass XML format

<!--? XML version= "1.0"?-->

<methodcall>

<methodname>examples.getStateName</methodname>

<params>

<param>

<value><i4>41</i4></value>

</params>

</methodcall>

Second, JSON format

1. Open the login page of the blog park, enter the account password and grab the packet, view the post submission data, and click Raw to view the raw data of the entire request.

2. The previous POST request is one body part, the red area is the body part of the blog login interface, it is obvious that this format is the first JSON format mentioned earlier

3. View the JSON-formatted tree structure to be more friendly and open the JSON menu item.

4. Looking at the JSON data here, it is clear that three parameters have been passed:

--INPUT1: This is the login account parameter (encrypted)

--input2: This is the secret parameter of login (encrypted)

--remember: This is the login page tick whether to remember the password option, false is not remember, true is to remember

Third, x-www-form-urlencoded

1. Log in to the blog after the park, open a new essay, casually write a title and a text after saving, grab the packet data as follows

2. In this format, it is obvious that the second type of data is viewed in Webfrom.

3. The query string above the red box is the parameter inside the URL, and the body part of the red box below is the body parameter part of the post submission.

Iv. Webfrom

1. Why is the body part of the webfrom of the login request empty?

2. See the Red box display: Here only support application/x-www-form-urlencoded This format of the body parameters, that is, JSON format, you need to josn this column to view the

Five, XML

1. If you encounter the body of the text/xml format, it's like this.

Fiddler grab Packet 7-post request (JSON)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.