Questions tagged [pytest-aiohttp]

26 questions
0
votes
1 answer

aiohttp: fast parallel downloading of large files

I'm using aiohttp to download large files (~150MB-200MB each). Currently I'm doing for each file: async def download_file(session: aiohttp.ClientSession, url: str, dest: str): chunk_size = 16384 async with session.get(url) as response: …
user3599803
  • 6,435
  • 17
  • 69
  • 130
0
votes
2 answers

python - how to submit concurrent api requests for trading purposes

So I have a list of instruments in a csv that looks like this: EUR_HUF EUR_DKK USD_MXN GBP_USD CAD_CHF EUR_GBP GBP_CHF ... To submit an order on an individual instrument is done by doing this api request: import asyncio import aiohttp import…
Harry
  • 27
  • 5
0
votes
1 answer

Faust.web API Server hangs on exception

I am new to Python and Faust. We are using Faust.web to develop our APIs. Everything seems to be working except exceptions. Problem is, when we run API server and hit a API from Postman that results in exception in our code, we correctly get 500…
ujjwal
  • 428
  • 3
  • 16
0
votes
1 answer

How can i fix the problem with aiohttp or aiogram?

aiogram.utils.exceptions.NetworkError: Aiohttp client throws error: ClientConnectorError: Cannot connect to host api.telegram.org:443 ssl: default [Semaphore timeout exceeded] I had this error when i was running the code of my telegram bot. Then, I…
Ulxn
  • 1
  • 3
0
votes
0 answers

Using https proxy with aiohttp

I need to fetch data from an https url. I've learned that aiohttp doesn't support https proxy. Is there a way to overcome this. I've read lots of previous replies but couldn't find anything. async def fetch(url, session): async with…
aksh02
  • 178
  • 1
  • 8
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
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
0 answers

AIOHTTP: web.run_app(app,port=9090) ^ SyntaxError: invalid syntax

whenever i try to integrate templates in aiohttp im facing this issue i dont know where exactly the issue is from here is my code from aiohttp import web from routes import setup_routes import aiohttp_jinja2 import jinja2 app =…
john
  • 539
  • 2
  • 9
  • 24
0
votes
1 answer

await resp.prepare(request) AttributeError: 'NoneType' object has no attribute 'prepare'

async def index(request): async with aiohttp.ClientSession() as client: data=await(email_verification(client)) await client.post('http://127.0.0.1:8000/acc/signup',data=data) async def email_verification(client): async…
john
  • 539
  • 2
  • 9
  • 24
0
votes
1 answer

aiohttp api error handler framework

we have developed some of the aiohttp server side apis and from that api we am calling one of the python class, where i have done all business logic. now we want to create a error handling framework for all apis, please give some ideas to implement…
-1
votes
1 answer

How to run a async http test in python using pytest aiohttp

I want to test a http call to an api that i don't own ( integration test ). I have created a class with an async function that makes a http call using aiohttp. I have then made a test case to run this function and assert the status of…
Kay
  • 17,906
  • 63
  • 162
  • 270
1
2