harp_apps.http_client.events

Inheritance diagram of harp_apps.http_client.events

class HttpClientFilterEvent[source]

Bases: Event

Custom event class embedding an httpx.Request and an optional httpx.Response, allowing to filter external requests made by the client. It also allows script execution, providing some context for systems like filtering rules (see rules application).

__init__(request, response=None)[source]
Parameters:
  • request (Request)

  • response (Response | None)

create_execution_context()[source]
execute_script(script)[source]
Parameters:

script (Callable)

set_response(response)[source]
Parameters:

response (Response)

property criteria
property endpoint
property fingerprint
EVENT_FILTER_HTTP_CLIENT_REQUEST = 'http_client.filter.request'

Event fired when an external request is about to be sent by the HTTP client.

EVENT_FILTER_HTTP_CLIENT_RESPONSE = 'http_client.filter.response'

Event fired when an external response is received by the HTTP client.