Questions tagged [AIOHTTP] (1)

1
answer

How to get the text html page using aiohttp?

Run the code import aiohttp async with aiohttp.ClientSession() as session: async with the session.get('http://httpbin.org/get') as resp: print(resp.status) print(await resp.text()) This error File "/home/mov/PycharmProjects/parser/test_.py", line 3 async with aiohttp.ClientSession() as session: ^ SyntaxError: 'async wit...
Ona_Baumbach asked April 8th 20 at 17:55
2
answers

CORS error when using aiohttp Angular8 and how to configure?

Good afternoon. Faced with the problem. There is backing for AIOHTTP . Pricha front in angulare. While trying to query the API in the browser console error appears Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at 127.0.0.1:8080/api/v3/driver/all/. (Reason: CORS preflight respon...
ashlee asked April 7th 20 at 15:48
1
answer

How to optimize the implementation of long poll, to deliver messages to clients from a redis pub/sub for asynchronous python?

There are a couple of thousand devices, which receive from the monitoring server event notifications and commands. Devices pure c++ and websocketpp, and that is a big problem with highly unstable connection via gprs. If you need to send a message from server received a connection error and wait until the client finally thro...
Jackeline82 asked April 7th 20 at 09:00
1
answer

How to repeat query in aiohttp, if there was a response, not 200?

Good day like to repeat the request in aiohttp, if there was a response, not 200? The point is not to exit the loop and immediately do a second request.
Derek asked April 4th 20 at 13:15
1
answer

Is it possible to simplify the script with aiohttp?

Took from aiohttp documentation example and applied it to retrieve json via http. Here is the script:import aiohttp import asyncio import json async def fetch(session, url): async with the session.get(url) as response: return await response.text() async def main(): async with aiohttp.ClientSession() as session: string...
verner_Sawayn59 asked April 4th 20 at 12:47
1
answer

Whether to use WebSocket in this implementation?

Good time! Began the task to implement the following functionality: requires that when a user visits a website it blocked for others. In the current implementation, use the server raised in AIOHTTP and communicate with the frontend through WebSocket. You also need to check whether the user performs any action, if some time ...
muriel_Huel asked April 4th 20 at 01:24
2
answers

How to call the same function after n seconds?

The server is written on aiohttp web. The server is the intermediary between the database and mobile applications. You need to add the update to the server every n seconds came to a certain web page, and under certain conditions called another function. However, he must continue to accept requests from mobile. I implemented...
Gwendolyn asked April 3rd 20 at 18:43
2
answers

Is there a universal tool to work with proxy aiohttp?

For example, socks proxies you need to use aiohttp_socks, an http proxy takes itself aiohttp, https (don't know what I can do with it, because if you open to shove it in proxy="https://" it never works with https and that with him at all then do not clear) I have a proxy list here in this format:[ '5.9.201.68:3128', #http o...
mustafa_Schiller asked April 3rd 20 at 16:58
0
answer

How to keep websocket-s on the server for aiohttp?

Hi all. Writing chat rooms, in which the General chat. On the server use aiohttp and websocket stored in the application instance. There are several cases in which the application ultimately issues: socket.send() raised exception. As far as I understand, if the socket state has changed (went from a chat, updated chat), anot...
santino_Harber1 asked April 1st 20 at 15:32
2
answers

How to dynamically change data on a page?

The database is mongodb, using motor I get information about changing it, and I need to display the resulting data on the page use aiohttp how can I do this ?
glen.Barton47 asked March 31st 20 at 20:53