Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send GET request with url-encode #3601

Closed
ZeroTworu opened this issue Feb 7, 2019 · 3 comments
Closed

Cannot send GET request with url-encode #3601

ZeroTworu opened this issue Feb 7, 2019 · 3 comments

Comments

@ZeroTworu
Copy link

Request string before 359 client.py
default
And after 369 i see
default
How this work?
inb4: i read docs, and see sources

@aio-libs-bot
Copy link

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

Possibly related issues are #1528 (Can't GET or POST request for custom ports with URL), #1901 (Request params do not encode right), #161 (aiohttp can't send files by POST request correct), #2861 (Is there any way to not re-encode url passed to ClientSession._request() ?), and #2076 (Request content is not returned on specific URL).

@asvetlov
Copy link
Member

asvetlov commented Feb 7, 2019

@ZeroTworu
Copy link
Author

ZeroTworu commented Feb 12, 2019

I think it is better to write here than to open a new issue.

Python 3.6, aiohttp 3.5.4, requests 2.21.0 I got a problem
I have a website which should be parsed, if I throw GET request through
requests.Session() I get content and can process it.
If I throw GET through aiohttp.ClientSession(), the system detected me like some bot after moment.

I used different cookies and user agents, nothing changed. The question: how is aiohttp different from another one? How can I solve it?
Code for aiohttp:

    def __init__(self):
        self.session = aiohttp.ClientSession(requote_redirect_url=False)

    async def get(self, url, **kwargs):
        res = await self.session.get(url, **kwargs)
        return res
url = URL('domain.com/checkcaptcha?%s' %
                          urlencode({'key': key, 'retpath': ret_path, 'rep': user_answer['captchaSolve']}), encoded=True)
 res = await self.get(url)

@lock lock bot added the outdated label Feb 14, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants