Four ways to submit data with the HTTP POST method

Source: Internet
Author: User
Tags http post

In the HTTP protocol, the POST method is used to submit data to the server, which is described in four ways:

    1. application/x-www-form-urlencoded
    2. Multipart/form-data
    3. Application/json
    4. Text/xml

Because it works under the HTTP protocol, here's what the HTTP protocol looks like.

features of the HTTP protocol :

    1. It is recommended that the application layer above TCP/IP be transmitted by ASCII code;
    2. The HTTP request is divided into three parts, the request request line, the message header, the message body, where the message header and the body of the message are separated by a blank line (CR/LF):
<method> <request-URL> <version>

The Protocol stipulates that post submission data needs to be placed in the body of the message, but is not qualified for encoding. The Content-type property in the message header can be used by the server to learn

The data encoding method, the article first said four kinds of ways, actually is four kinds of content-type.

First, content-type:application/x-www-form-urlencoded

The most common way, examples are as follows:

POST http://www.example.com http/1.1content-type:application/x-www-form-urlencoded;charset= utf-8title=test&sub%5b%5d=1&sub%5b%5d=2&sub%5b%5d=3

Not to be continued.

Main reference articles:

"1" four common POST-submission data ways by a drop in the sea

Four ways to submit data with the Post method of HTTP

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.