HTTP Request data and show in template in OctoberCMS

460 Views Asked by At

I am new to OctoberCMS, I am wondering if it is possible to use http request to fetch data from an external api?

I tried to google this but couldn’t find any results. Maybe I’m searching using the wrong terms.

Can anyone please give me ANY info or tutorials? I know how to do it in PHP but not exactly sure how to integrate it in octobercms and its template page

Thanks

1

There are 1 best solutions below

0
On
  1. Create a routes.php file at the root of your plugin

  2. Add the following code example to the file (routing like in laravel): enter image description here

  3. Open your address and enter localhost/test-request in the address bar