mercredi 9 novembre 2016

Laravel 5.3 How to get Api data using GuzzleHttp

I have build a laravel application where I want to access API data from other application. For that I've installed GuzzlHttp package. But instead of getting actual data I'm getting Empty array. How do I solved the issue? any idea or suggestion please?

Here is controller I have used to get the other application API data:

public function saveApiData()
                {
                    $client = new Client(['base_uri' => 'http://localhost/atom/public/']);
                    $response = $client->get('api/show');
                    $contents = $response->getBody()->getContents();
                    dd($contents);
                }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire