我正在尝试将以下查询 shopware5 API 的工作 HTTP_Request2 代码移植到 Guzzle 7
$request = new \HTTP_Request2();
$request->setBody('{"limit": 500000}');
$request->setUrl($URL.'/customers');
$request->setMethod(\HTTP_Request2::METHOD_GET);
$request->setHeader('Accept-Encoding','gzip, deflate, br');
$request->setAuth($username, $apiKey, \HTTP_Request2::AUTH_DIGEST);
$response = $request->send();
我尝试了以下操作,但失败并显示消息“无效或缺少身份验证”
$RESTClient = new Client();
$request = new Guzzle_request(
'GET',
$URL .'/customers',
[
'body' => '{"limit": 500000}',
'decode_content' => 'gzip, deflate, br',
'auth' => [$username, $apiKey, 'digest']
]);
$response = $RESTClient->send($request);