Let's have a look at the concept of request and the different HTTP request methods.
Understanding Requests
A Look at HTTP Request Methods
Having set up our server, we are ready to start building our API. The routes are basically what constitute the actual API.
We will first look at HTTP request methods (sometimes referred to as HTTP verbs), then apply them to our API using a simple todo list example. We will look at five major ones:
- GET: Requests a representation of the specified resource. Requests using GET should only retrieve data, and should not be used to make changes to resources.
- POST: Is used to submit an entry to a specified resource, often causing a change of state.
- PUT: Replaces all current representations...