The difference between HTTP header accept and Content-type

Source: Internet
Author: User

1.Accept belongs to the request header, and Content-type belongs to the entity header.

The HTTP header is divided into generic headers, request headers, response headers, and entity headers.

HTTP header structure for requester: Generic header | request Header | entity header

HTTP header structure of the responder: generic header | response Header | entity header

2.Accept represents the type of data that the sending side (client) wants to accept.

For example: Accept:text/xml;

Represents the data type that the client wants to accept as XML type

Content-type represents the data type of the entity data sent by the sending side (client | server).

For example: content-type:text/html;

The data format sent on behalf of the sending side is HTML.

3. Combination of the two

Accept:text/xml;

Content-type:text/html

This means that the data type that you want to accept is in XML format, and the data format for the data sent by this request is HTML.

Reference:

http://blog.csdn.net/muzizongheng/article/details/46795243 (the above content is transferred from this article)

The difference between HTTP header accept and Content-type (RPM)

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.