Types of Requests .... Sir didn't explain them

Sir had it written, the types of requests - 1) GET 2)POST 3)PATCH 4)PUT and some other but I think he forgot to explain them…can you please explain them.

Hey @nikhil_sarda, GET, POST, PUT, PATCH, and DELETE are the five most common HTTP methods for retrieving from and sending data to a server.

  1. The GET method is used to retrieve data from the server. This is a read-only method, so it has no risk of mutating or corrupting the data.

  2. The POST method sends data to the server and creates a new resource. The resource it creates is subordinate to some other parent resource. When a new resource is POSTed to the parent, the API service will automatically associate the new resource by assigning it an ID (new resource URI). In short, this method is used to create a new data entry.

  3. The PUT method is most often used to update an existing resource. If you want to update a specific resource (which comes with a specific URI), you can call the PUT method to that resource URI with the request body containing the complete new version of the resource you are trying to update.

  4. The PATCH method is very similar to the PUT method because it also modifies an existing resource. The difference is that for the PUT method, the request body contains the complete new version, whereas for the PATCH method, the request body only needs to contain the specific changes to the resource, specifically a set of instructions describing how that resource should be changed, and the API service will create a new version according to that instruction.

  5. The DELETE method is used to delete a resource specified by its URI.

I hope this information helps you. Please mark the doubt resolved if it is clear.
Happy Learning :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.