March 2019
Beginner
490 pages
12h 40m
English
HTTP can be used as a method of transport for any type of file or data. The server can use the 'Content-Type' header in a response to inform the client about the type of data that it has sent in the body. This is the primary means with which an HTTP client determines how it should handle the body data that the server returns to it. To view the content type, we inspect the value of the response header, as shown here:
>>> response = urlopen('http://www.debian.org')>>> response.getheader('Content-Type')'text/html'
These values are called content types, internet media types, or MIME types. The full list can be found at http://www.iana.org/assignments/media-types.
Content type values can contain optional additional parameters that ...
Read now
Unlock full access