Reading HTTP headers.
HTTP headers tell you the type of content. For example:
content-type: application / xml.
There are two ways to determine the type of content.
- file extension called by url
- http header content type
The first was somewhat advanced by Microsoft in the old days and is no longer good practice.
If the client has display restrictions that accept only a certain type of content, it requests a server with headers, for example
accept: application/json accept: text/html accept: application/xml
And then, if the server can provide one of them and select XML, it will return the contents with the header
content-type: application/xml.
However, some services include additional information, such as
content-type: application/xml; charset=utf-8
rather than using your own caption to encode characters.
Blessed geek
source share