PHP knowledge point 3-HTTP header-The difference between Accept and Content-Type

WBOY
Release: 2016-07-28 08:26:58
Original
1416 people have browsed it

1.Accept belongs to the request header, and Content-Type belongs to the entity header.
Http headers are divided into general headers, request headers, response headers and entity headers.
The http header structure of the requester: Universal header|Request header|Entity header
The HTTP header structure of the responder: Universal header|Response header|Entity header
2.Accept represents the data type that the sender (client) wants to accept.
For example: Accept: text/xml;
Represents that the data type that the client wants to accept is xml type
Content-Type represents the data type of entity data sent by the sender (client|server).
For example: Content-Type: text/html;
It means the data format sent by the sender is html.
The combination of the two,
Accept:text/xml;
Content-Type:text/html
means that the data type you want to accept is xml format, and the data format of the data sent in this request is html.

The above introduces the difference between PHP knowledge point 3-HTTP header-Accept and Content-Type, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!