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. ...

Get PHP Microservices now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.