Symfony Goutte/Guzzle setDefaultOption()方法无效

Symfony Goutte/Guzzle setDefaultOption()方法无效,symfony,goutte,Symfony,Goutte,在类GUZLE HTTP/Client中找不到错误方法setDefaultOption 还有代码完成找不到的方法。 例子来自 我确实在喝Guzzle~6,因此此代码有效: use Goutte\Client; /** * code removed */ class ......... { public function xxxxxx() { $client = new Client(); $client->getClient()->setDefault

在类GUZLE HTTP/Client中找不到错误方法setDefaultOption 还有代码完成找不到的方法。 例子来自

我确实在喝Guzzle~6,因此此代码有效:

use Goutte\Client;

/**
 * code removed
 */
class  ......... {

  public function xxxxxx() {

    $client = new Client();
    $client->getClient()->setDefaultOption('config/curl/'.CURLOPT_TIMEOUT, 60);

我写了那些文件。仔细检查您使用的Guzzle版本,当您在6上时,这些文档可能是Guzzle 4-5的。您确定$client不是Guzzle HTTP\client的实例吗?
$crawler = $client->request('GET', 'http://www.example.com',
                              ['curl' => ['CURLOPT_TIMEOUT' => 60]]);