Glossary Term
HTTP Request
Learn what an HTTP request is and how clients send messages to servers. Understand request structure, methods, headers, and body components.
TL;DR: A message sent by a client to a server asking for a resource or action. The foundation of all web communication.
An HTTP request is a message sent by a client (like your web browser) to a server asking it to do something. Think of it like ordering food at a restaurant - you tell the waiter what you want, and they pass that request to the kitchen.
Every HTTP request has four main parts:
- Method: What action you want (GET to retrieve data, POST to send data)
- URL: Where you want to send the request (like https://howhttpworks.com/api/store)
- Headers: Extra information about the request (like what type of data you accept)
- Body: The actual data you’re sending (optional, mainly used with POST/PUT)
HTTP requests matter because they’re how all web communication works. Every time you click a link, submit a form, or load an image, your browser sends an HTTP request.
Examples:
- GET request: Visiting a webpage - your browser requests the HTML content
- POST request: Submitting a login form - your browser sends username/password to the server
- API request: A mobile app requesting weather data from a weather service
Related terms: HTTP Response, HTTP Method, HTTP Header
Frequently Asked Questions
What is an HTTP request?
An HTTP request is a message sent by a client to a server asking for a resource or action. It includes method, URL, headers, and optionally a body.
What are the parts of an HTTP request?
Request line (method, URL, version), headers (metadata), blank line, and optional body (data). Example: GET /page HTTP/1.1 followed by headers.
What is the request body?
The body contains data sent to the server, used with POST, PUT, PATCH. It can be form data, JSON, files, etc. GET requests typically have no body.
How do I see HTTP requests?
Use browser DevTools Network tab, or tools like curl, Postman, or Wireshark. DevTools shows all requests your page makes with full details.