When I build a web application, it often also has a mobile component, so a RESTful API is always used.
Now for the admin console, and any other web based component on the site, rather than re-implementing the RESTful API, we use it internally for the site functionality and for dynamic AJAX driven sites.
This leads to lots of internal requests to different API endpoints, sometimes a few at once for perhaps creating a “vendor” type user, first there’d be a call to POST /api/vendor, and within /api/vendor it would create a user account with POST /api/user.
Doing external requests to itself via curl involves a lot of overhead, like re-instantiating a new DB instance, and the entire stack PHP stack really. An internal request would already have most of the components loaded, so would be much quicker.
From the direction my development’s gone, it seems a RESTful driven site really drives the need for internal requests.
I didn’t see anyway to call an API request in the docs, is there a way?