Aiohttp: Question: Difference between ClientResponse.url and .real_url

Created on 25 Mar 2019  路  3Comments  路  Source: aio-libs/aiohttp

Sorry, for using _Issues_ as Q&A board but there was no response on the mailinglist.
X-Post: https://groups.google.com/forum/#!msg/aio-libs/ibZkny12BpM/ci7sEQjlAQAJ

My question is about ClientResponse class.

What is the difference between ClientResponse.urland ClientResponse.real_url?

I can not find any.

e.g. I tried to get this URL
https://www.fsf.org/static/fsforg/rss/news.xml
which is redirected to
https://static.fsf.org/fsforg/rss/news.xml

question

All 3 comments

GitMate.io thinks the contributor most likely able to help you is @asvetlov.

Possibly related issues are https://github.com/aio-libs/aiohttp/issues/2992 (question), https://github.com/aio-libs/aiohttp/issues/1670 (ClientResponse ergonomics), https://github.com/aio-libs/aiohttp/issues/1898 (Any difference between url and url_obj in URL), https://github.com/aio-libs/aiohttp/issues/172 (Question about ServerHttpProtocol.closing()), and https://github.com/aio-libs/aiohttp/issues/824 (URL with #).

I hate bots.

Well, as you can see by code difference is about fragment part:
https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client_reqrep.py#L651-L652
https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client_reqrep.py#L668-L674
and that's what about documentations states on.

Was this page helpful?
0 / 5 - 0 ratings