While web developers can often get away with a minimal understanding of TCP/IP and DNS, they must understand HTTP much more deeply. Before diving into the details of HTTP, let's gain a high-level understanding.
The fundamental units of HTTP are requests and responses. A client (usually a web browser) makes a request to a web server. Based on the details of the request, the server formulates and sends a response. The response is parsed and displayed by the browser.
As long as the server is available, every request receives a single response.
Requests contain several types of data, including:
Responses include:
HTTP can seem complicated, but it is actually very similar to a system that you are already familiar with: The United States Postal Service.
Suppose you want to mail a letter to your friend in Alaska, asking them their favorite cheese. To do so, you write your question on a piece of paper and enclose it in an envelope. On the envelope, you write your friend's address, along with your return address. Finally, you affix a stamp to the top-right corner.
Each of these pieces of information is necessary for your letter to be delivered. When your letter enters the postal system, it will travel from one post office to another, via land, air, and maybe even sea. As long as you follow their rules, the postal service will get your letter to its destination.
This is very similar to how an HTTP request works. The letter is like a request message. The envelope contains the location and metadata needed for the letter to be delivered, just like an HTTP request specifies a URL and other metadata necessary for the request to reach the server and be processed.
When you drop the letter in your mailbox, you know it will be delivered since you followed the postal service's rules. When we make HTTP requests, we don't know how our request will get to the server, but as long as we properly structure a request, it will be delivered.
And just as your friend will respond with a letter telling you their favorite cheese (sharp white cheddar!), an HTTP request will result in a response from the server.
As we wade into the details of HTTP, keep this analogy in mind. It will help simplify the concepts and make them more concrete.
Question
In your own words, explain the role of HTTP in enabling communication over the Internet.
Question
Answer true or false for each of the following statements.