mardi 30 mai 2017

Laravel not found http exception

Hi I have a simple controller where I want to get content from a page using guzzle, however I am having trouble viewing any of the results because I keep getting error "NotFoundHttpException"

My route:

Route::get('hello', 'GuzzleController@test');

Controller:

function test(){
    $client = new GuzzleHttp\Client();
    $res = $client->get('http://ift.tt/N8YLMI', ['auth' =>  ['user', 'pass']]);
    echo $res->getStatusCode(); // 200
    echo $res->getBody(); // { "type": "User", ....
    return view('hello');
}

view:

{!! $res !!}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2shAvwI
via IFTTT

Aucun commentaire:

Enregistrer un commentaire