Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to use custom HttpRequest classes for client.request #8

Merged
merged 1 commit into from
Jan 29, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions aiohttp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def request(method, url, *,
session=None,
verify_ssl=True,
connection_params=None,
loop=None):
loop=None,
request_class=None):
"""Constructs and sends a request. Returns response object.

method: http method
Expand Down Expand Up @@ -87,9 +88,11 @@ def request(method, url, *,
redirects = 0
if loop is None:
loop = asyncio.get_event_loop()
if request_class is None:
request_class = HttpRequest

while True:
req = HttpRequest(
req = request_class(
method, url, params=params, headers=headers, data=data,
cookies=cookies, files=files, auth=auth, encoding=encoding,
version=version, compress=compress, chunked=chunked,
Expand Down