Requestor¶
The Requestor is the lowest-level component in asyncprawcore. It wraps an
aiohttp.ClientSession and is responsible for issuing the actual HTTP requests
to Reddit. Subclass it to customize request behavior, for example to add caching or
logging.
- class asyncprawcore.requestor.Requestor(user_agent, oauth_url='https://oauth.reddit.com', reddit_url='https://www.reddit.com', session=None, loop=None, timeout=16.0)¶
Requestor provides an interface to HTTP requests.
- Parameters:
user_agent (str)
oauth_url (str)
reddit_url (str)
session (aiohttp.ClientSession | None)
loop (asyncio.AbstractEventLoop | None)
timeout (float)
- request(*args, timeout=None, **kwargs)¶
Issue the HTTP request capturing any errors that may occur.
- Parameters:
- Return type:
- Returns:
The response from the request.
- Raises:
RequestException: If an error occurs while issuing the request.