我尝试随请求发送自定义标头,但不断发送默认标头。
这是GuzzleClient我的代码中的创建
$httpClient = new \GuzzleHttp\Client( [
'headers' => [
['Accept' => ' text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'],
['Accept-Language' => 'en-US,en;q=0.5'],
['Upgrade-Insecure-Requests' => '1'],
['User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'],
['Accept-Encoding' => 'gzip, deflate, br']
]
] );
Run Code Online (Sandbox Code Playgroud)
但是我看到默认的标题(用户代理:Guzzle)
我的代码有什么问题