The difference between Http header Accept and Content-Type

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. 
        Requester's HTTP Header Structure: Generic Header | Request Header | Entity Header 
        Responder's HTTP Header Structure: Generic Header | Response Header | Entity Header

 

2.Accept represents the data type that the sender (client) wants to accept. 
        For example: Accept: text/xml; 
        the data type that the client wishes to accept is the xml type

        Content-Type represents the data type of the entity data sent by the sender (client|server). 
        For example: Content-Type: text/html; 
        means that the data format sent by the sender is html.

 

Combining 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 by this request is html.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326486316&siteId=291194637