| 1536 | return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) |
| 1537 | |
| 1538 | def patch( |
| 1539 | self, |
| 1540 | path: str, |
| 1541 | *, |
| 1542 | cast_to: Type[ResponseT], |
| 1543 | body: Body | None = None, |
| 1544 | content: BinaryTypes | None = None, |
| 1545 | files: RequestFiles | None = None, |
| 1546 | options: RequestOptions = {}, |
| 1547 | ) -> ResponseT: |
| 1548 | if body is not None and content is not None: |
| 1549 | raise TypeError("Passing both `body` and `content` is not supported") |
| 1550 | if files is not None and content is not None: |
| 1551 | raise TypeError("Passing both `files` and `content` is not supported") |
| 1552 | if isinstance(body, bytes): |
| 1553 | warnings.warn( |
| 1554 | "Passing raw bytes as `body` is deprecated and will be removed in a future version. " |
| 1555 | "Please pass raw bytes via the `content` parameter instead.", |
| 1556 | DeprecationWarning, |
| 1557 | stacklevel=2, |
| 1558 | ) |
| 1559 | opts = FinalRequestOptions.construct( |
| 1560 | method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options |
| 1561 | ) |
| 1562 | return self.request(cast_to, opts) |
| 1563 | |
| 1564 | def put( |
| 1565 | self, |