aiohttp.protocol.Request

Here are the examples of the python api aiohttp.protocol.Request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: aiohttp Source File: test_protocol.py
def test_start_request(transport):
    msg = protocol.Request(
        transport, 'GET', '/index.html', close=True)

    assert msg.transport is transport
    assert msg.closing
    assert msg.status_line == 'GET /index.html HTTP/1.1\r\n'

Example 2

Project: aiohttp Source File: test_protocol.py
def test_dont_override_request_headers_with_default_values(transport):
    msg = protocol.Request(
        transport, 'GET', '/index.html', close=True)
    msg.add_header('USER-AGENT', 'custom')
    msg._add_default_headers()
    assert 'custom' == msg.headers['USER-AGENT']