Routing
Routing is a mapping between the entry points of your application (requests) and a specific class and method in your source that executes your logic. For example, you can have defined in your application a mapping between the /users
route and the method list()
which is inside your Users
class. Once you have this mapping in place, as soon as your application receives a request for the route /users
, it will execute all the logic you have inside the list()
method (located in the Users
class). Routing allows the API consumers to interact with your application. In microservices, the RESTful convention is the most used and we will follow it.
HTTP Methods:
GET: It is used to retrieve information about a specified entity or collection of entities. The amount of data does not matter; we will use GET for one or many results, and also we can use filters in order to filter the results.
POST: It is used to enter information in the application. It is also used to send new information in order...