【发布时间】:2018-01-23 23:00:05
【问题描述】:
升级到 Guzzle6 后,我不知道如何为客户端设置默认查询字符串。
我有以下几点:
$client = new \GuzzleHttp\Client( [
'base_uri' => 'http://api.example.org/',
'query' => ['key' => 'secretKey']
] );
$client->get( 'extract', ['query' => ['url' => $url]] );
在此请求中,我的默认查询字符串 key=secretKey 被忽略。
我怎样才能让它工作?
【问题讨论】: