Introduction to HTTP

HTTP (Hypertext Transfer Protocol) is the foundation of how data communicates on the web. It defines how messages are formatted and sent, and how the recepients should respond to various requests.

Basic Concepts

Example HTTP Request and Response

Request:

GET /index.html HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0

Response:

HTTP/1.1 200 OK
Content-Type: text/html

<html>
  <head><title>Example</title></head>
  <body><h1>Hello, World!</h1></body>
</html>
Start the challenge!