-
-
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
Aiohttp failing to get response on awaited urls #3432
Comments
GitMate.io thinks the contributor most likely able to help you is @asvetlov. Possibly related issues are #660 (aiohttp.request hangs on some URLs), #2920 (AIOHttp failing after some requests), #2540 (Drop await aiohttp.request(...)), #1403 ([QUESTION] aiohttp.ClientSession.request('GET') issue), and #3427 (Readd aiohttp.{get,post,...} shortcuts). |
I afraid we cannot help you: none of all three used functions ( Hint: the exception is raised by |
Hi, Thanks for the prompt reply. Sorry for not providing enough information. async def fetchAll(session, tasks=[], urls):
for url in urls:
print(url)
task = asyncio.ensure_future(fetchNew(session, url))
tasks.append(task)
result = await asyncio.gather(*tasks)
return result
#Note: I am using this with Sanic |
|
Sorry guys found a small bug in the code that was doing it. Thanks for the prompt reply. |
Long story short
Aiohttp failing to get response on awaited urls
When using awaited
allUrls
I am getting the following erroraiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: '
When I hardcode the urls (by printing them previously) in the variable
urls
, it gives the expected outputExpected behaviour
It should be same in both cases. I am dynamically generating the urls and I might be missing something really basic.
The text was updated successfully, but these errors were encountered: