The multipart content that `body` is sent as next to a file.
(self, body: Mapping[str, object])
| 96 | return dict(self.request.url.params) |
| 97 | |
| 98 | async def form(self, body: Mapping[str, object]) -> bytes: |
| 99 | """The multipart content that `body` is sent as next to a file.""" |
| 100 | options = make_request_options(extra_headers={"Content-Type": "multipart/form-data; boundary=boundary"}) |
| 101 | files = [("file", b"contents")] |
| 102 | if isinstance(self._client, Anthropic): |
| 103 | self._client.post("/foo", body=body, files=files, options=options, cast_to=httpx2.Response) |
| 104 | else: |
| 105 | await self._client.post("/foo", body=body, files=files, options=options, cast_to=httpx2.Response) |
| 106 | return self.request.content |
| 107 | |
| 108 | |
| 109 | @pytest.fixture(params=[True, False], ids=["sync", "async"]) |
no test coverage detected