From my previous blog we learnt about the evolution of HTTP, and what HTTP really is, and how it has evolved since then till now.
In this part, we will delve deep into the HTTP structure and what it has to offer. As we are learning backend engineering from its first principles, these topics form the fundamentals.
HTTP Methods
These methods are the building blocks for building any REST API, as every API call you make is an HTTP method you apply to a resource.
These methods are nothing but actions that the client want to perform on the resource.
Now, you might ask, “What is a resource?” Well, a resource is like a piece of data, say for example, like “Users”, “Products,” etc.
https://api.praddycompany.com/users→ represents a collection of user resourceshttps://api.praddycompany.com/users/42→ represents a single user resource with ID42
The HTTP methods that we have to interact with these resources are
What is idempotency ?
If an operation is performed multiple times, but the result remains the same, meaning doing it multiple times is equal to doing it once, then this is called idempotency.
- GET /users/123 -> If I am fetching a user with an ID, then doing it once or multiple times will always return the same user.
- PUT /users/123 -> If you replace an existing resource with new data once, and if you keep doing it again, it will just keep overwriting the same resource.
- POST /users/123 -> When u do it once, it creates a new resource once, but when you do it again and again, it keeps creating a new resource every time. Hence, it is not idempotent.
HTTP Status Codes
Every time a client sends a request, like we discussed in Part 1, there is a certain response structure, and Status code is one of them . Its a 3 digit number which will tell you how the request went.
- 1XX Informational
- 2XX Success
- 3XX Redirection
- 4XX Client Errors
- 5XX Server Errors
Now, Hope you all got an understanding of HTTP Codes, Idempotency and Status Codes, and how and why they are useful in backend engineering.
In the next blog, we’ll cover HTTP Headers, Preflight Requests and CORS and many more things in backend engineering.
If you liked this post, please like, comment and share it with your fellow backend learners, and follow me for Part 3 coming soon!
Subscribe to my Substack
Get thoughtful insights on technology, AI, and software engineering delivered straight to your inbox. No spam, ever.
- Weekly Updates
- I will send you an update each week to keep you filled in on what I have been up to.
- No Spam
- Your email stays private, I’ll never share or sell it.







