“NIO” Respostas de código

NIO

That's the one
Exuberant Eagle

NIO

params = [('key', 'value1'), ('key', 'value2')]
async with session.get('http://httpbin.org/get',
                       params=params) as r:
    expect = 'http://httpbin.org/get?key=value2&key=value1'
    assert str(r.url) == expect
Lovely Leopard

NIO

200
'[{"created_at":"2015-06-12T14:06:22Z","public":true,"actor":{...
Lovely Leopard

NIO

Chinese Tesla
Excited Elephant

NIO

async def main():
    async with aiohttp.ClientSession() as session:
        async with session.get('http://httpbin.org/get') as resp:
            print(resp.status)
            print(await resp.text())


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Lovely Leopard

NIO

session.put('http://httpbin.org/put', data=b'data')
session.delete('http://httpbin.org/delete')
session.head('http://httpbin.org/get')
session.options('http://httpbin.org/get')
session.patch('http://httpbin.org/patch', data=b'data')
Lovely Leopard

NIO

params = {'key1': 'value1', 'key2': 'value2'}
async with session.get('http://httpbin.org/get',
                       params=params) as resp:
    expect = 'http://httpbin.org/get?key1=value1&key2=value2'
    assert str(resp.url) == expect
Lovely Leopard

NIO

await resp.text(encoding='windows-1251')
Lovely Leopard

NIO

b'[{"created_at":"2015-06-12T14:06:22Z","public":true,"actor":{...
Lovely Leopard

NIO

import aiohttp
import asyncio
Lovely Leopard

Respostas semelhantes a “NIO”

Procure respostas de código populares por idioma

Procurar outros idiomas de código