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 !!}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire