Reading cookies and headers
As we have learned from the earlier chapters of this book, when an HTTP client sends a request to a web server, it includes one or more headers that are in a key/value pair. These headers are meant to be part of a meta-conversation between the client and the server. And since an HTTP connection is a two-sided transaction with both a request and a response, we must bear in mind that there is a distinction between request headers and response headers.
This chapter focuses only on HTTP requests. Therefore, we will only be covering material related to request headers. This is worth pointing out because there are some headers that are commonly found in both the request and the response. One such example is Content-Type, which can be used by both HTTP requests and HTTP responses. So, keep this in mind when we talk about Content-Type in this section it relates to HTTP requests only. There is a time and a place for discussing response headers. Feel free to skip...