This document is for Kombu's development version, which can be significantly different from previous releases. Get the stable docs here: 5.0.

Source code for kombu.asynchronous.http

from kombu.asynchronous import get_event_loop

from .base import Headers, Request, Response

__all__ = ('Client', 'Headers', 'Response', 'Request')


[docs]def Client(hub=None, **kwargs): """Create new HTTP client.""" from .curl import CurlClient return CurlClient(hub, **kwargs)
def get_client(hub=None, **kwargs): """Get or create HTTP client bound to the current event loop.""" hub = hub or get_event_loop() try: return hub._current_http_client except AttributeError: client = hub._current_http_client = Client(hub, **kwargs) return client