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

Event Source doesn't represent an information at each client/session

I have a python server-side which sends a request using SSE. Here the example of python code. It sends an 'action-status' and data which JS has to handle (to do): async def sse_updates(request): loop = request.app.loop async with…
JuiceFV
  • 171
  • 11
0
votes
1 answer

How to get my smartThings python3 script working on apache webserver as a cgi file

My father and I are making a webserver so Grafana will be able to access a few python scripts; Grafana only allows you to add links to buttons. Earlier today we created the webserver. Then I started work on two python files, "smartThingy.py" and…
0
votes
1 answer

Concurrent HTTP and SQL requests using async Python 3

first time trying asyncio and aiohttp. I have the following code that gets urls from the MySQL database for GET requests. Gets the responses and pushes them to MySQL database. if __name__ == "__main__": database_name = 'db_name' …
Shery
  • 1,808
  • 5
  • 27
  • 51
0
votes
1 answer

Associating aiohttp requests with the responses

I would simply like to associate responses from aiohttp asynchronous HTTP requests with an identifier. I am using the following code to hit the API and extract contactproperty object which requires an external field (contacid) in order to call its…
jack mh
  • 75
  • 1
  • 7
0
votes
1 answer

how do i get aiohttp to output reddit images

@commands.command(aliases=['gt']) async def cat(self, ctx): """Outputs image from r/greentext""" async with ctx.typing(): async with aiohttp.ClientSession() as cs: async with…
NotJohan
  • 27
  • 6
0
votes
1 answer

Unable to get the right file name using multipart headers

I'm working on a kind of personal cloud project which allows to upload and download files (with a google like search feature). The backend is written in python (using aiohttp) while I'm using a react.js website as a client. When a file is uploaded,…
Th0rgal
  • 703
  • 8
  • 27
0
votes
1 answer

Lose session in websocket

i try to make chat, and when I make webSocket connection, I lose session data, where stored user auth token, therefore I cant check user authentication. When I load page which contains form for webSocket connection, there are all session data. I…
0
votes
1 answer

how does aiohttp handle onclick function

I am a newbie for the aiohttp, and I have a question below, First, I have a button in the page as below, and in the python code, I define the function as…
rainbirdy
  • 15
  • 2
0
votes
1 answer

How to call a method of an object returned from an async function without parentheses in Python?

I got this function: async def download(url): async with aiohttp.ClientSession() as session: async with session.get(url) as resp: if resp.status == 200: return resp To get the data, I'd need to write: text =…
Dlean Jeans
  • 966
  • 1
  • 8
  • 23
0
votes
1 answer

Aiohttp: Server & Client in one time

I try to use aiohttp 3.6.2 both server and client: For webhook perform work: 1) Get JSON-request from service 2) Fast send HTTP 200 OK back to service 3) Made additional work after: make http-request to slow web-service(answer 2-5 sec) I dont…
0
votes
1 answer

Change&Save an html file through a server side

I have an issue regard a html-file changing through server-side. I'ill explain: I am trying to build a Queue Management System and I wish to display a queue on the client-side. It's should seems like that: But the problem is that I do not know how…
JuiceFV
  • 171
  • 11
0
votes
1 answer

retrieve only uploaded files in aiohttp

How can we retrieve only the uploaded files from the Request object? Example: We can retrieve the JSON body from the request with the help of json() coroutine, json_body = await request.json() Similarly, Can I have the uploaded files without…
JPG
  • 82,442
  • 19
  • 127
  • 206
0
votes
1 answer

How to implement a CURL -o in Python using request or aoihttp

I need to do a get to a URL with certain Headers and Parameters in my python code and then write to an excel file. I am trying the below code but getting the below error when I try to open the excel file. Also given below is a redacted version of a…
0
votes
1 answer

Adding route to aiohttp WSGI handler

I am trying to run a WSGI app as described here https://aiohttp-wsgi.readthedocs.io/en/stable/wsgi.html The following code works: app = web.Application() app.router.add_route("*", "/{path_info:.*}", wsgi_handler) But, I want to add path like…
user2698178
  • 366
  • 2
  • 11
0
votes
1 answer

Cannot connect to aiohttp server serving over HTTPS

Background: I'm writing a web server using aiohttp with a websocket endpoint at /connect. The app was originally served via HTTP (and clients would connect to ws://host/connect). This worked locally using localhost, but when I deployed to Heroku,…
Peter Wang
  • 1,808
  • 1
  • 11
  • 28