You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, if I read well, encoded=True is to use only when we have URL already built: Passing params overrides encoded=True, never use both options.
In my case, I want the client to build the URL and encode my parameters.
And aiohttp doc lets me think, it will do the encoding: You can see that the URL has been correctly encoded by printing the URL. (with a quite simple example with no "strange" character).
It is probably not clear enough but in my example: A%20B is not an URL encoded value, but the raw string I am manipulating. A more concrete example may be params = { 'a': 'Only today: save %20 on my awesome product!' }.
With requests which as a similar syntax, I got the expected behaviour:
Long story short
When passing params as a dict to make client queries, I expect them to be correctly encoded so the original value is retrieved by the server.
Expected behaviour
When passing a dict:
params = { 'a': 'A%20B' }
to a ClientSession, I expect the query to be formatted as?a=A%2520B
Actual behaviour
Query looks like
?a=A+B
Steps to reproduce
Output:
Expected output:
Server side PHP code:
In doc it is written that
dict
params will be encoded but notstr
: https://docs.aiohttp.org/en/stable/client_quickstart.html#passing-parameters-in-urlsYour environment
aoihttp client 3.5.4
python 3.6.3
The text was updated successfully, but these errors were encountered: