Appendix A. HTTP Primer
“Why certainly, sir! Here it is straight-away.”
While perhaps a tad on the formal side, this simple verbal interaction represents a real-world example of a request for something, followed by a response that satisfies that request. Such simple interactions are the heart and soul of the HTTP protocol—the standard protocol on which the World Wide Web depends.
So what the Dickens does Dickens have to do with the Web? Let’s find out.
Yes, why? After all, between the browsers and the server-side libraries available to us, we never really have to know what’s going on beneath the surface, do we?
When a form is submitted, or a link is clicked, the browser takes care of creating and sending the request to the server. And when the response is returned, the browser interprets it and acts accordingly on our behalf. Server-side mechanisms, such as PHP or the Servlet and JSP mechanisms of J2EE, take care of parsing the request in order to make its information (cookies, parameters, headers, and so on) available to our server-side code via a tidy API. Such facilities also create and send the response on our behalf using an equally tidy API. So why bother learning anything about the guts of HTTP at all?