如何在 Guzzle 6 中禁用 URL 编码
How to disable URL encoding in Guzzle 6
我正在使用 pipedrive API,我想提出这样的请求:
GET https://api.pipedrive.com/v1/deals(id,title,value,currency)?api_token=YOUR_API_TOKEN
它工作正常,例如。当我使用浏览器发出请求时,但当我使用 Guzzle 发送请求时,我收到响应 501。我假设它以 Pipedrive API.
无法识别的方式进行编码
有没有办法在 Guzzle 6 中禁用 URL 编码?
这似乎是一个错误,我不是唯一面临此问题的人:
- https://github.com/guzzle/guzzle/issues/1121
- https://github.com/guzzle/psr7/commit/962735c754f2a562a619b456a3aa4e614f0e5360
提交消息:
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: "(", ")", "*", "!", "'"
我正在使用 pipedrive API,我想提出这样的请求:
GET https://api.pipedrive.com/v1/deals(id,title,value,currency)?api_token=YOUR_API_TOKEN
它工作正常,例如。当我使用浏览器发出请求时,但当我使用 Guzzle 发送请求时,我收到响应 501。我假设它以 Pipedrive API.
无法识别的方式进行编码有没有办法在 Guzzle 6 中禁用 URL 编码?
这似乎是一个错误,我不是唯一面临此问题的人:
- https://github.com/guzzle/guzzle/issues/1121
- https://github.com/guzzle/psr7/commit/962735c754f2a562a619b456a3aa4e614f0e5360
提交消息:
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: "(", ")", "*", "!", "'"