How to use the respx.models.ContentStream function in respx

To help you get started, we’ve selected a few respx 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 lundberg / respx / respx / models.py View on Github external
async def araw(self):
        stream = ContentStream(await self.acontent)
        return (
            f"HTTP/{self.http_version}".encode("ascii"),
            self.status_code,
            b"",
            self.headers.raw,
            stream,
        )
github lundberg / respx / respx / models.py View on Github external
def raw(self):
        stream = ContentStream(self.content)
        return (
            f"HTTP/{self.http_version}".encode("ascii"),
            self.status_code,
            b"",
            self.headers.raw,
            stream,
        )