Python Aiohttp Proxies

0
8K

The following example shows how to use aiohttp to handle HTTP requests. We’ll send an HTTP GET request to the https://ip.example.com web page. After receiving the request, the web page returns the IP address of the requester. 

Let’s start by creating the get_response() async function:

async def get_response():

    async with aiohttp.ClientSession() as session:

        async with session.get( 'https://ip.example.com/' ) as response:

            print('Status Code: ', response.status)

            print('Body: ', await response.text())

Zoeken
Categorieën
Read More
Programming
Python Motor vs Pymongo
Motor provides a single client class, MotorClient. Unlike PyMongo’s MongoClient,...
By Jesse Thomas 2023-07-12 21:04:17 0 9K
Social Issues
L.A. Confidential. (1997)
As corruption grows in 1950s Los Angeles, three policemen - one strait-laced, one brutal, and one...
By Leonard Pokrovski 2023-01-30 14:31:19 0 20K
Жизненные вопросы
Могила светлячков. Grave of the Fireflies. (1988)
Последние дни Второй мировой войны, американская авиация бомбит беззащитные японские города. В...
By Nikolai Pokryshkin 2022-12-05 21:42:35 0 23K
Life Issues
Money Fight. (2020)
A group of friends decides to document their lives as they search for an underground fight club...
By Leonard Pokrovski 2023-05-08 20:24:48 0 26K
Programming
Python super()
super() lets you avoid referring to the base class explicitly, which can be nice. But the main...
By Jesse Thomas 2023-03-23 22:24:20 0 8K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov