lundi 4 septembre 2017

HTTP Request Laravel - GuzzleHttp

I find myself trying Laravel - GuzzleHttp with a simple request, following the documentation: For now this code works:

<?php

   use GuzzleHttp\Client;

   Route::get('/', function () {

   $client = new Client([

    'base_uri' => 'http://ift.tt/2bVh1Xu',

    'timeout'  => 2.0,
  ]);

 $response = $client->request('GET', 'users');

//return $response->getBody()->getContents();
  return json_decode( $response->getBody()->getContents());


  return view('welcome');
});

I would like the same answer for this API: http://ift.tt/2ez37wv

where:

  • base ur -> http://ift.tt/2iWWR6J
  • feed id -> 08zurhnuvbsmt5ygphI53ryx8gKFrku05LJ
  • URL -> message.json


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire