-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
HTTP GET + compress=True = 501 #117
Comments
Can you add code showing how you are making the request? I've just tryied the following code and both >>> import asyncio
>>> import aiohttp
>>> import requests
>>> loop = asyncio.get_event_loop()
>>> resp = loop.run_until_complete(
... aiohttp.request('GET', 'http://httpbin.org',
... connector=aiohttp.ProxyConnector('http://173.234.226.20:8800')))
>>> resp
... <ClientResponse [403 Forbidden]>
>>> requests.get('http://httpbin.org', proxies={'http': '173.234.226.20:8800'})
... <Response [403]> |
Hm... the thing was not in proxy, its about compress=True @asyncio.coroutine
def get(url):
proxy = random.choice(PROXIES)
response = yield from aiohttp.request(
'GET', url, compress=True, connector=aiohttp.ProxyConnector(proxy=proxy)
)
print("{0} - {1} - {2}".format(url, response.status))
return (yield from response.read_and_close())
if __name__ == '__main__':
# Proxies initializing
loop = asyncio.get_event_loop()
tasks = [get(url) for url in get_records()]
loop.run_until_complete(asyncio.wait([get(url) for url in get_records()])) |
Aha, I see. Making 'GET'-request with We will into this. |
well, nervous is wrong word, buggy is right :) |
is it still the problem? |
I think it must be still an issue based on comments in #835. |
@danielnelson what to fix it? |
sure |
Fixed by #891 |
There are some strange behavior with proxies. Trying to do HTTP GET request, requests package gives correct result, asyncio - 501.
Response headers:
SERVER - squid/3.1.4
MIME-VERSION - 1.0
DATE - Mon, 14 Jul 2014 20:20:15 GMT
CONTENT-TYPE - text/html
CONTENT-LENGTH - 3136
X-SQUID-ERROR - ERR_UNSUP_REQ 0
VIA - 1.0 host (squid/3.1.4)
Proxy - 173.234.226.20:8800
Seems that GET method for such proxy is incorrect, even if request done through http.
Any suggestions?
The text was updated successfully, but these errors were encountered: