中间件错误laravel guzzle

时间:2016-09-23 12:24:43

标签: php laravel guzzle

我在laravel

上收到此错误
ClientException in Middleware.php line 69:
Client error: 400

in Middleware.php line 69
at Middleware::GuzzleHttp\{closure}(object(Response)) in Promise.php line 199
at Promise::callHandler('1', object(Response), array(object(Promise), object(Closure), null)) in Promise.php line 152
at Promise::GuzzleHttp\Promise\{closure}() in TaskQueue.php line 60

当我执行此代码以调用Facebook API

$client = new GuzzleHttp\Client();
    foreach($buzzes as $buzz ){
      $link = $buzz->link;

      $link_part = explode('/', $link);
      $post_id = $link_part[5];
      if(is_numeric($post_id)){
        //Check if we can embed the video /  not live / not private

        $url = 'https://graph.facebook.com/v2.6/'.$post_id.'/?fields=embeddable,live_status&access_token='.$permanent_token;


        //dd($response->getBody());

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

        echo $response->getBody().'<br />';

      }

    }

我不知道如何修复此错误

0 个答案:

没有答案