如何使Guzzle避免编码form_params

问题描述 投票:0回答:1

我正在使用此代码:

    $res = $client->request('POST', $this->host, [
        'auth' => [$customer_key, $customer_secret],
        'form_params' => [
            'grant_type' => 'client_credentials',
            'scope' => 'scope_one+scope_two',
        ],
    ]);

问题在于,范围参数的编码方式类似于scope_one%2Bscope_two,但是服务器正在像scope_one+scope_two那样请求它。我该如何解决?

php guzzle
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.