I am trying to fetch data and integrate into application from get api in laravel but getting this error
"cURL error 28: Operation timed out after 30011 milliseconds with 0 bytes received".
I am able to get response from same api in postman. also i tried third party api's with same laravel code and i am able to fetch data with those apis.
My laravel code
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Http;
use Illuminate\Http\Request;
class ApiController extends Controller
{
public function index()
{
$bookingData = Http::get("http://127.0.0.1:8000/api/viewbookings");
return json_decode($bookingData);
}
}
my Api response i am getting through postman
{
"message": "data sucessfully fetched",
"data": [
{
"name": "Pratik Zajam",
"booking_date": "2023-09-23",
"timeslot": "10-11"
},
{
"name": "Pratik Zajam",
"booking_date": "2023-09-23",
"timeslot": "11-12"
},
{
"name": "Pratik Zajam",
"booking_date": "2023-09-24",
"timeslot": "11-12"
}
]
}
I tried to test my laravel code with third party apis and it did worked. but not able to data through my own api.