Guzzle6 错误资源类型无效:发送 GuzzleHttp\Psr7\Request 时的数组

Guzzle6 error Invalid resource type: array when send a GuzzleHttp\Psr7\Request

我正在尝试使用 GuzzleHttp\Psr7\Request 发送代码,但不知何故我收到错误无效的资源类型:数组,以下是我的代码

$params = ["name"=>"myName","id"=>"myId"];
$client = new Client();
$request = new Request('PUT','https://api.hitbox.tv/media/live/myName?authToken=myToken',["content-type"=>'application/json'],["json"=>$params]);

$response = $client->send($request);

我正在关注 指南。

如果你想在请求中使用JSON,只需使用json_encode()创建它:

$request = new Request(
    'PUT',
    'https://api.hitbox.tv/media/live/myName?authToken=myToken',
    ["content-type" => 'application/json'],
    json_encode($params)
);