在hyperf中如何调用外部接口
安装`composer require hyperf/guzzle`
代码如下
```
'http://www.test.com.cn',
'handler' => HandlerStack::create(new CoroutineHandler()),
'timeout' => 5,
'swoole' => [ // 看这里看这里
'timeout' => 10,
'socket_buffer_size' => 1024 * 1024 * 2,
],
]);
$response = $client->get('/index/goods/list/is_ajax/1?goods_type=2 ');
error_log(print_r($response->getBody()->getContents(),true),3,"/tmp/1.txt");
$result = $response->getBody()->getContents();
return $result;
}
}
```