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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.