How to use the http3.AsyncResponse function in http3

To help you get started, we’ve selected a few http3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github encode / requests-async / requests_async / asgi.py View on Github external
raw_kwargs = {"content": b""}  # type: typing.Dict[str, typing.Any]
        template = None
        context = None

        try:
            await self.app(scope, receive, send)
        except BaseException as exc:
            if not self.suppress_exceptions:
                raise exc from None

        if not self.suppress_exceptions:
            assert response_started, "TestClient did not receive any response."
        elif not response_started:
            raw_kwargs = {"status_code": 500, "headers": []}

        raw = http3.AsyncResponse(**raw_kwargs)
        response = self.build_response(request, raw)
        if template is not None:
            response.template = template
            response.context = context
        return response

http3

The next generation HTTP client.

BSD-3-Clause
Latest version published 5 years ago

Package Health Score

66 / 100
Full package analysis