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
1 answer

Can't check if user exist in Postgres DB aiohttp

Here you can see model of User with its methods class User: def __init__(self, db, data, *kw): self.db = db self.username = data[0] self.pass_hash = argon2.argon2_hash(data[1], salt=b'salty salt') async def…
Lilly
  • 59
  • 1
  • 1
  • 9
0
votes
1 answer

Fetch HEAD request's status asynchronously in aiohttp

Question is regarding aiohttp libriary usage. My goal here is to check list of urls by sending bunch of HEAD requests, potentially asynchronously ,and eventually create dict of url: status pairs. I am new in asyncio and stuff and I found a lot of…
Aleksei Khatkevich
  • 1,923
  • 2
  • 10
  • 27
0
votes
1 answer

aiohttp set_cookies doesn't set cookies

I have this view: async def accept_token(request): resp = web.Response(text='cookies were set') resp.set_cookie('name', 'value, path='/', max_age=3600) return resp But I see…
Dmitry Sazhnev
  • 383
  • 3
  • 16
0
votes
0 answers

when to type await ? with using aiohttp in python

I use aiohttp . at what places of app do I need to type await ? as I know there are cases: when code is about session async def get(self): session = await get_session(self.request) when code is about database def __init__(self,…
user
  • 61
  • 7
0
votes
0 answers

Running 10 functions asynchronously in Djano Views using Asyncio

Im facing difficulties while trying to execute around 10 functions simultaneously using asyncio in Django. I could not find nay clear documentation on how to use asyncio with django. I made around 10 http requests to different using TOR which is by…
Adithyan AK
  • 1
  • 1
  • 1
0
votes
1 answer

Make an async HTTP request and continue executing the loop

I have a simple python function with the following pseudo-code: while True: # 1 - CPU Intensive calculations(Synchronous) # 2 - Take the result from the synchronous calculation and POST it to a server The while loop runs forever…
Varun
  • 95
  • 1
  • 11
0
votes
2 answers

Unable to access Http request data after await in Python3.5 asyncio

I've been trying to play with Python3.5 aiohttp and I wrote this simple wrapper function - async def perform_async_http(self, url, method, data='', headers={}): async with aiohttp.ClientSession() as session: if method.lower() == 'get': …
Roy Rashti
  • 196
  • 2
  • 15
0
votes
1 answer

Need some advice on speeding up HTTP requests in python

I need to send over 1 million HTTP requests and so far every option I've tried is just way too slow. I thought I could speed it up with aiohttp but that doesn't seem any faster than requests. I was trying to do it with python but I'm open to other…
0
votes
1 answer

How to quickly deploy a Aiohttp Python project on Heroku or similar

I've got an aiohttp based project in Python, not overly complicated, just takes advantage of the async routes, etc. I'd like to quickly deploy to Heroku and cannot find a recent step by step. I've tried using their standard Gunicorn approach and…
Stacey Reiman
  • 666
  • 4
  • 13
0
votes
1 answer

Why aiohttp create thread in every iteration?

I try using aiohttp for sending some request in loop. When I run this code I see in process list threads at first iteration: 5 thread, next iteration after 5 sec add 5 thread, etc I try find answer, but I only found info about aiodns, I test with…
Evgenii G.
  • 45
  • 2
  • 8
0
votes
0 answers

Unable to upload to Azure blob asynchronously with python

I'm trying to upload images to azure blob storage and before uploading I'm checking with head request to make sure that file doesn't exists. Code runs well but stops after sometime. I tried to close file but it is not working. Below is my code from…
0
votes
1 answer

Marshmallow List of objects with any schema

I'm using ApiSpec in an aiohttp service for building the docs. Now I need to create a JSON method that takes a list of objects in a free form, with no fields restrictions. So, is it possible to specify a schema with a list of objects with any fields…
AivanF.
  • 1,134
  • 2
  • 23
  • 52
0
votes
0 answers

aiohttp BaseConnector _acquired vs _conns

I see internally connections (
0
votes
0 answers

Cycling through IP addresses in Asynchronous Webscraping

I am using a relatively cookie cutter code to asynchronously request the HTMLs from a few hundred urls that I have scraped with another piece of code. The code works perfectly. Unfortunately, this is causing my IP to be blocked due to the high…
TNoms
  • 81
  • 4
0
votes
1 answer

aiohttp monkey patch to work with nest_asyncio

I used nest_asyncio in my python project. And everything works perfect except that aiohttp function get_running_loop has some warning message that fill all my logs. The aiohttp used the implementation for their get_running_loop similar to: def…
Роман Коптев
  • 1,555
  • 1
  • 13
  • 35