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

Make Python Async Requests Faster

I am writing a get method that gets an array of ids and then makes a request for each id. The array of ids can be potentially 500+ and right now the requests are taking 20+ minutes. I have tried several different async methods like aiohttp and async…
Demetrius
  • 449
  • 1
  • 9
  • 20
0
votes
1 answer

Object Is Not JSON Serializable When Using JSON Dumps

I am using an async method to return an array of objects and I am getting a "TypeError: is not JSON serializable" error and I am not sure how to correct it. Here is my code: async def fetch(session, url): async with session.get(url) as…
Demetrius
  • 449
  • 1
  • 9
  • 20
0
votes
1 answer

Electrum Merchant Crashing

I am trying to get electrum merchant running, and it keeps crashing on me. I have tried using several different versions of python3; (python3.6.0, 3.6.8, and 3.7), but I keep getting this same error when I try to run it: python3.6 -m…
Chev_603
  • 313
  • 3
  • 14
0
votes
0 answers

aiohttp replaces %3A with :

My API server wants the URL to have %3A which I generate using urllib parse quote. However when I pass the URL to aiohtttp it replaces it with ':' . How to avoid this ? Example : END POINT = http://server/item_url/http%3A// when i pass…
Ram K
  • 1,746
  • 2
  • 14
  • 23
0
votes
1 answer

Start HTTP sever without blocking UI

I'm trying to create a simple GUI app in python that runs a webserver, but I don't know how to start the server without blocking the UI. I was trying to start it on a new thread, but it still blocks the UI. Here is a sample of my code: import…
Razero
  • 321
  • 1
  • 4
  • 16
0
votes
0 answers

How to async return from aiohttp server handler?

I am running a http server to handle slack API calls which arrive at the events endpoint. The slack documentation suggests that the app (this server) needs to acknowledge the receipt of the request within 3 seconds (which can be achieved by an empty…
Akshay Shah
  • 704
  • 4
  • 11
0
votes
1 answer

How to redirect POST request using aiohttp

I'm using python3 and aiohttp http server to handle requests from client.How should I redirect a POST request with body data? I've tried aiohttp.web.HTTPFound('/redirect') it works with GET requests,but what if the request is POST?
yag
  • 11
  • 4
0
votes
1 answer

Translate in aiohttp

There is some app with aiohttp used just for REST. Front written in React/Redux. The most part of application is translated on Frontend side. But there are also message generated by aiohttp on server side (for example messages about form…
Mike
  • 860
  • 14
  • 24
0
votes
0 answers

Run two concurrent task groups asynchronously with asyncio

I am trying to write a program using asyncio and was oriented towards this blog post. What I am trying to do is fetch some JSON data concurrently. For one input data frame. however, I would like to process the requested data further as soon as it…
Peterhack
  • 941
  • 4
  • 15
  • 34
0
votes
0 answers

How to make asynchronous program output sequentially?

I use a python library(aiohttp) to get the response form post request. Can I get sequential result? How to...? import aiohttp import asyncio import base64 import json from tqdm import tqdm import time f =…
0
votes
0 answers

Asyncio attribute error, pyinstaller bundle

Application works, but when I'm trying to run it as executable I receive such error: File "venv\Lib\site-packages\aiohttp\tcp_helpers.py", line 20, in AttributeError: module 'asyncio' has no attribute 'Transport' [8748] Failed to execute…
Rostislav Aleev
  • 351
  • 5
  • 19
0
votes
1 answer

Using Socket IO and aiohttp for data transfer between node JS and Python

My overall goal is to generate a stream of random numbers in a JavaScript file (which is run using node) and send them to a python script in asynchronous time intervals. Once the numbers are in python, the script will determine if the numbers are…
W. Churchill
  • 346
  • 1
  • 7
  • 28
0
votes
0 answers

Get url without blocking the function

I'm trying to get a resource from a url inside a route on a web server without blocking it since getting it sometimes takes 11 seconds+. I switched from flask to aiohttp for this. async def process(request): data = await request.json() req =…
K41F4r
  • 1,443
  • 1
  • 16
  • 36
0
votes
1 answer

Can't run client-server application with docker

Good day! I wrote client and server applications, I run them via docker, but client app couldn't connect to server. Client's code: import requests import json class Client: def attach_comp_to_employee(self, employee_id, company): try: …
Kirill
  • 33
  • 7
0
votes
2 answers

Tracking dangling threads in python

I've got a python 3.7.2 asyncio based application. There is an endpoint exposing some thread info: threads_info = {} for thread in enumerate(): threads_info[thread.__str__()] = traceback.format_stack(sys._current_frames()[thread.ident]) For all…