Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By joe casey on
I have a string which could be an API call, like '/node/1'. From within my module, how do I get the API response? That is, get the json the API call would generate, but without leaving the current bootstrapped session?
There is an example at https://github.com/RESTful-Drupal/restful/wiki/Using-the-API-within-Drupal but it is for D7 and includes functions no longer in D8.
Comments
Hi,
Hi,
Why can't you use http_client service or Restful webservice module.
It might help you.
That would require another
That would require another full bootstrap of Drupal, which is what I'm trying to avoid.