Construct a generic request object.
(self, **request)
| 717 | return scope |
| 718 | |
| 719 | def request(self, **request): |
| 720 | """Construct a generic request object.""" |
| 721 | # This is synchronous, which means all methods on this class are. |
| 722 | # AsyncClient, however, has an async request function, which makes all |
| 723 | # its methods async. |
| 724 | if "_body_file" in request: |
| 725 | body_file = request.pop("_body_file") |
| 726 | else: |
| 727 | body_file = FakePayload("") |
| 728 | # Wrap FakePayload body_file to allow large read() in test environment. |
| 729 | return ASGIRequest( |
| 730 | self._base_scope(**request), LimitedStream(body_file, len(body_file)) |
| 731 | ) |
| 732 | |
| 733 | def generic( |
| 734 | self, |