REST API is commonly known especially for web based projects. But most of the time, people just aware only on POST and GET.
But first what is REST API? REST API (Representational State Transfer Application Programming Interface) is an architectural style for designing networked applications that uses standard HTTP methods to enable communication between different computer systems over the internet.
What is the real usage of this REST API? Imagine running a restaurant with clients and waiters.
Client: Can I get/see the menu? (GET)
Client: I want to order a glass of fresh orange (POST)
Client: I want to change this order from chicken to meat (PATCH)
Client: Can we change some of our orders? (PUT)
Client: I want to cancel/delete this order (DELETE)
1. GET: “Can I see this?” or “Can I retrieve this info?”.. This is to find and get the data. You just want to get it and see it. That’s all. (Example: Fetching a user profile).
2. POST: “I want to submit this application”… You have a detailed information and you want to submit it to the system. Example, you want to register an account and you submit all the needed info.
3. PATCH: “I just want to edit this particular info only”.. Like example, you want to change the profile picture, so you just send the PATCH request to edit and save that one picture only.
4. PUT: “Replace all the data with this new data”… If you read properly it means that PUT is a request to change many/huge information. It is different with PATCH.
5. DELETE: “Delete this row of data”… Well… it’s.. so obvious.
So especially for students, this is the simplest way to understand REST API without the technical jargon or whatsoever. Using the right HTTP method for your project is absolutely necessary and a must. Why? It’s to prevent….. disaster (it’s happen more often that you might think of).
What is REST API? Simple Edition

Leave a Reply