Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e57621

Browse files
committed
Fix aio-libs#1898: cast resp.url to str before comparison
1 parent 04dfcf8 commit 6e57621

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/client.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ following code::
8383
params = {'key1': 'value1', 'key2': 'value2'}
8484
async with session.get('http://httpbin.org/get',
8585
params=params) as resp:
86-
assert resp.url == 'http://httpbin.org/get?key2=value2&key1=value1'
86+
assert str(resp.url) == 'http://httpbin.org/get?key2=value2&key1=value1'
8787

8888
You can see that the URL has been correctly encoded by printing the URL.
8989

@@ -97,14 +97,14 @@ that case you can specify multiple values for each key::
9797
params = [('key', 'value1'), ('key', 'value2')]
9898
async with session.get('http://httpbin.org/get',
9999
params=params) as r:
100-
assert r.url == 'http://httpbin.org/get?key=value2&key=value1'
100+
assert str(r.url) == 'http://httpbin.org/get?key=value2&key=value1'
101101

102102
You can also pass :class:`str` content as param, but beware -- content
103103
is not encoded by library. Note that ``+`` is not encoded::
104104

105105
async with session.get('http://httpbin.org/get',
106106
params='key=value+1') as r:
107-
assert r.url == 'http://httpbin.org/get?key=value+1'
107+
assert str(r.url) == 'http://httpbin.org/get?key=value+1'
108108

109109
Response Content
110110
----------------
@@ -308,7 +308,7 @@ send large files without reading them into memory.
308308
As a simple case, simply provide a file-like object for your body::
309309

310310
with open('massive-body', 'rb') as f:
311-
await session.post('http://some.url/streamed', data=f)
311+
await session.post('http://httpbin.org/post', data=f)
312312

313313

314314
Or you can use `aiohttp.streamer` object::

0 commit comments

Comments
 (0)