Response
Setting Response Status
Delayed Response
The DelayedResponse is an extension of the regular Response class. It allows you to not only set the response status, body, and headers but also introduces a delay before sending the response.
Relay Response
RelayResponse is designed to forward incoming requests to a specified target URL. It is particularly useful for creating proxy mocks to test real server responses without directly hitting the target server. This enables seamless testing against external services by relaying responses from a target URL back to the client.
Template Response
The TemplateResponse class provides a flexible way to define dynamic HTTP responses using Jinja2 templates. It allows you to craft responses whose body, headers, and status code can be rendered dynamically based on the incoming request’s context as well as additional data you provide via the context parameter.