What is an HTTP request?
An HTTP request is a message your browser or app sends to a server asking for something. It’s one half of the HTTP request-response cycle that powers the web.
Every request has a few key parts. The method tells the server what you want to do: GET to fetch something, POST to send data, DELETE to remove something. The URL tells the server what resource you’re targeting. Headers carry metadata like what format you accept or who you are. Some requests also include a body, which is the data you’re sending along.
When the server receives the request, it processes it and sends back an HTTP response with a status code and usually some content. A 200 means it worked. A 404 means the resource wasn’t found. A 500 means something went wrong on the server’s end.
Every time you load a web page, your browser is firing off multiple HTTP requests simultaneously. One for the HTML, more for images, stylesheets, scripts, and fonts. When you submit a form or call an API, that’s an HTTP request too. They’re the basic building block of everything that happens on the web.