Knowing how HTTP requests work is the first step in debugging any web app. HTTP defines how clients and servers exchange messages. When a frontend loads a list of services, it sends a request to an endpoint. The server sends back a status code, headers, and often a body. Reading those messages is one of the quickest ways to find where a web app is failing.
How HTTP requests work: follow one request
Suppose a dashboard requests GET /api/services. The method tells the server that the client wants to read information. The path identifies the resource, and the Accept: application/json header tells the server which representation the client prefers.
After processing the request, the server might return 200 OK with Content-Type: application/json and a list such as [{"id":42,"name":"Design review"}]. The frontend can read the status and parse the JSON to render the result.
Read status codes before debugging the page
201 Createdmeans the request created a resource.400 Bad Requestmeans the server considers the request invalid. Check the payload and parameter format.401 Unauthorizedmeans valid authentication credentials are missing or invalid.403 Forbiddenmeans the server refuses access. Check the account’s permissions.404 Not Foundmeans the requested resource was not found. Check the full path and environment.500 Internal Server Errorpoints you toward application logs on the server.
Try it in your browser
Open Developer Tools, choose Network, and reload this page. Select the document request and find its method, response status, and content type. Next, open a page in an app you control that fetches JSON. Filter for Fetch/XHR and compare the request headers and response preview. Avoid including cookies or authorization headers when sharing a screenshot.
Continue with Engineering on Zonedak Open.
Once you’ve tried a developer quickstart, learn how to turn a reproducible setup snag into a documentation contribution.
Common HTTP methods
The method tells the server what you want to do with the resource in the URL.
| Method | What it does | Example |
|---|---|---|
| GET | Reads data without changing it | Load a list of services |
| POST | Sends data to create something or trigger an action | Submit a contact form |
| PUT | Replaces a resource with the data you send | Update a full user profile |
| PATCH | Changes part of a resource | Update only an email address |
| DELETE | Removes a resource | Delete a saved draft |
HTTP status code families
The first digit of a status code tells you which side to investigate.
| Range | Meaning | Common examples |
|---|---|---|
| 1xx | Informational | 100 Continue |
| 2xx | Success | 200 OK, 201 Created, 204 No Content |
| 3xx | Redirection | 301 Moved Permanently, 304 Not Modified |
| 4xx | Client error: check the request | 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found |
| 5xx | Server error: check the server | 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable |
Frequently asked questions
What is an HTTP request?
An HTTP request is a message a client, such as a browser or app, sends to a server to ask for a resource or an action. It contains a method, a URL, headers and sometimes a body.
What is the difference between GET and POST?
GET asks the server for data and should not change anything. POST sends data in the request body, usually to create something or trigger an action, such as submitting a form.
What does a 404 status code mean?
A 404 means the server understood the request but could not find the resource at that URL. Check the path, spelling and any IDs in the URL first.
Is HTTPS different from HTTP?
HTTPS is HTTP sent over an encrypted TLS connection. The requests and responses look the same to your code, but other people on the network cannot read or change them.
Related guides
- What is AI engineering? A beginner’s roadmap with a real project, where calling a model API is the first step
- How to fix a setup guide upstream with your first open-source contribution
- Pull request review checklist
- For the full reference, read the MDN overview of HTTP.
