How to disable URL encoding in Guzzle 6

1.3k views Asked by At

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?

1

There are 1 answers

0
Isinlor On BEST ANSWER

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: "(", ")", "*", "!", "'"