How to disable URL encoding in Guzzle 6

2019-09-07 19:54发布

I'm working with pipedrive API and I want to make such a request:

GET https://api.pipedrive.com/v1/deals(id,title,value,currency)?api_token=YOUR_API_TOKEN

It works fine eg. when I do the request with a browser, but when I send the request with Guzzle I get response 501. I assume that it gets encoded in a way that's not recognized by Pipedrive API.

Is there a way to disable URL encoding in Guzzle 6?

标签: php guzzle psr-7
1条回答
一纸荒年 Trace。
2楼-- · 2019-09-07 20:47

Seems like this is a bug and I'm not the only one facing this issue:

Commit message:

Fixing path URI encoding.

The previous pattern was incorrect:
    '/(?:[^' . self::$charUnreserved . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/'

The new pattern now properly follows RFC 3986:
    /(?:[^a-zA-Z0-9_\-\.~!\$&'\(\)\*\+,;=:@\/%]+|%(?![A-Fa-f0-9]{2}))/

This pattern now allows the following characters: "(", ")", "*", "!", "'"
查看更多
登录 后发表回答