Attention

This is the documentation for HARP Proxy, actually published as an early preview. Both the software and documentation are a work in progress, and although we already use it on various production servers, they may contain inaccuracies, typographical errors, huge mistakes and empty pages. We work hard to eradicate all mistakes and implement stuff, but it is a long and tedious process. We appreciate your patience and understanding. Of course, any help will be greatly appreciated.

harp_apps.http_client.settings

class CacheSettings[source]

Bases: DisableableBaseSettings

CacheSettings(enabled: Optional[bool] = True, transport: harp.config.settings.lazy.Definition[ForwardRef(‘AsyncCacheTransport’)] = Definition(path=’hishel’, name=’AsyncCacheTransport’, args=(), kwargs={}), controller: harp.config.settings.lazy.Definition[ForwardRef(‘Controller’)] = Definition(path=’hishel’, name=’Controller’, args=(), kwargs={‘allow_heuristics’: True, ‘allow_stale’: True, ‘cacheable_methods’: [‘GET’, ‘HEAD’], ‘cacheable_status_codes’: [200, 203, 204, 206, 300, 301, 308, 404, 405, 410, 414, 501]}), storage: harp.config.settings.lazy.Definition[ForwardRef(‘AsyncBaseStorage’)] = ConstantDefinition(path=None, name=None, args=None, kwargs=None, value=None))

__init__(enabled=True, transport=Definition(path='hishel', name='AsyncCacheTransport', args=(), kwargs={}), controller=Definition(path='hishel', name='Controller', args=(), kwargs={'allow_heuristics': True, 'allow_stale': True, 'cacheable_methods': ['GET', 'HEAD'], 'cacheable_status_codes': [200, 203, 204, 206, 300, 301, 308, 404, 405, 410, 414, 501]}), storage=ConstantDefinition(path=None, name=None, args=None, kwargs=None, value=None))
Parameters:
Return type:

None

controller: Definition[Controller] = Definition(path='hishel', name='Controller', args=(), kwargs={'allow_heuristics': True, 'allow_stale': True, 'cacheable_methods': ['GET', 'HEAD'], 'cacheable_status_codes': [200, 203, 204, 206, 300, 301, 308, 404, 405, 410, 414, 501]})
storage: Definition[AsyncBaseStorage] = ConstantDefinition(path=None, name=None, args=None, kwargs=None, value=None)
transport: Definition[AsyncCacheTransport] = Definition(path='hishel', name='AsyncCacheTransport', args=(), kwargs={})
class HttpClientSettings[source]

Bases: BaseSetting

HttpClientSettings(timeout: Optional[float] = 30.0, cache: harp_apps.http_client.settings.CacheSettings = <factory>, transport: harp.config.settings.lazy.Definition[ForwardRef(‘AsyncHTTPTransport’)] = Definition(path=’httpx’, name=’AsyncHTTPTransport’, args=(), kwargs={}))

__init__(timeout=30.0, cache=<factory>, transport=Definition(path='httpx', name='AsyncHTTPTransport', args=(), kwargs={}))
Parameters:
Return type:

None

cache: CacheSettings
timeout: float | None = 30.0
transport: Definition[AsyncHTTPTransport] = Definition(path='httpx', name='AsyncHTTPTransport', args=(), kwargs={})

HTTP transport to use for the client. This is usually a httpx.AsyncHTTPTransport (or subclass) instance.