Questions tagged [aiohttp]

Use this tag for questions about AIOHTTP – a client/server framework for asyncio Python.

AIOHTTP is an asynchronous asyncio Python web framework for both client and server sides. It supports HTTP, WebSockets, and also MiddleWare and Signals mechanics for the server side.

Useful links:

Related tags:

1628 questions
0
votes
0 answers

"None" is returned on the request in Python Asyncio

I have started learning asyncio in Python, want to fetch data from a URL. When i print the fixtures in fixtures.py and result in utils.py, i am getting "None" FILE fixtures.py import asyncio from utils import fetch class Fixture: def…
shanks
  • 1
  • 1
0
votes
0 answers

grahql-ws subscriptions aiohttp: how to allow subscriptions?

all! I try to use lib graphql-ws https://github.com/graphql-python/graphql-ws to create a subscription on a web-socket. I need to set execution option allow_subscriptions to True in execution of subscribe() of custom Observable class…
Kate Zz
  • 3,002
  • 5
  • 14
  • 17
0
votes
0 answers

How to set proxy for aiohttp in python?

I'm running a python program on pythonanywhere.com. So far I used requests.get() for my API calls. However I'd now like to use aiohttp to improve performance and make concurrent API calls. My problem is that, in pythonanywhere, requests() is…
luke
  • 61
  • 1
  • 5
0
votes
1 answer

cx_oracle + threadpool first insert call function slow

I have a problem, I use the cx_oracle + aiohttp + threadpollexecutor bundle to call a function in the database that checks parameters and insert data into Oracle tables. I noticed a strange feature: the very first request after midnight runs for…
RKG
  • 87
  • 4
0
votes
1 answer

how could I test a network bandwidth and latency using async python?

I have been looking for a way to test a network bandwidth in python. I had found the module of speedtest-cli but that module is only sync where I need an async solution and it also doesn't support the use of proxies either. Should I time the time it…
0
votes
1 answer

write unit test for async aiohttp and aio files

I am new with asyncio. I am using aiohttp and aiofiles for downloading images. how to write the unit tests for both of these. class ImageDownloader: def __init__(self, folder_path: str): self.folder_path = folder_path async def…
Sazzad
  • 773
  • 11
  • 22
0
votes
0 answers

How to keep on requesting on a set of URLs asynchronously (python)?

I have a set of URLs (same http server but different request parameters). What I want to achieve is to keep on requesting all of them asynchronously or in parallel, until I kill it. I started with using threading.Thread() to create one thread per…
Wayee
  • 379
  • 1
  • 5
  • 17
0
votes
1 answer

Any chance to shield create_task'ed task?

I need to shield a task been fired with create_task within an aiohttp handler process like async def handler(request): asyncio.create_task(long_process()) return {}, 200 So the code is import asyncio async def shielded(coro): try: …
Belegnar
  • 721
  • 10
  • 24
0
votes
0 answers

How can i make requests to https websites with auth proxy in aiohttp?

I am trying to make requests to https websites with auth proxy, but i am receiving the error below. As they mention in aiohttp documentation, there are no https proxy support, so i wonder if there is any solution to this problem. Here is also my…
hen
  • 65
  • 1
  • 7
0
votes
0 answers

Feedparser is not sanitizing html text downloaded via asyncio aiohttp

I am downloading feed using aiohttp asyncio Feedparser is supposed to sanitize input text with its _HTMLSanitizer class to accept only specific tags The sanitizer does not work, any suggestions? import aiohttp import asyncio import…
PirateApp
  • 5,433
  • 4
  • 57
  • 90
0
votes
1 answer

is chaining GET and POST requests bad?

I'm trying to upload some file to my file hosting service. I'm using aiohttp for it. My server is quite limited in storage and I thought of chaining GET and POST requests, so I don't have to download the file to local. I used the example given in…
0
votes
1 answer

Asyncio aiohttp populate list of HTML from list of URL

I'm trying to get a list of HTML source code from a list of URLs asynchronously with asyncio and aiohttp but I get 2 Exceptions: TypeError('An asyncio.Future, a coroutine or an awaitable is ' TypeError: An asyncio.Future, a coroutine or an…
0
votes
1 answer

Non-blocking websockets client using AIOHTTP

I'm trying to build a websocket live-chat client on Python using websockets from AIOHTTP. I'm having issues with msg = await ainput('> ') - this is blocking code. After i run this code, client blocked on this line until user enter some value. After…
0
votes
0 answers

aiobotocore s3 file upload it seems things not getting through

I am uploading an image and its thumb to an s3-bucket using simple aiobotocore usecase. Traceback is below. It seems things are not getting through. Could someone help sorting out whats went wrong here. Iam using aiohttp with this usecase. session =…
binrebin
  • 357
  • 4
  • 16
0
votes
0 answers

How does asyncio enable parallel IO waits?

I'm trying to understand how asyncio allows for multiple IO waits to happen in parallel. It is often said that asyncio enables concurrency, but not parallelism. From what I understand, this is true for Python code as such, but something must be…
Błażej Czapp
  • 2,478
  • 2
  • 24
  • 18