putrequest This deviates from the HTTPConnection method signature since we never need to override sending accept-encoding headers or the host header.
( # type: ignore[override]
self,
method: str,
url: str,
**kwargs: typing.Any,
)
| 110 | self.sock.sendall(data_to_send) |
| 111 | |
| 112 | def putrequest( # type: ignore[override] |
| 113 | self, |
| 114 | method: str, |
| 115 | url: str, |
| 116 | **kwargs: typing.Any, |
| 117 | ) -> None: |
| 118 | """putrequest |
| 119 | This deviates from the HTTPConnection method signature since we never need to override |
| 120 | sending accept-encoding headers or the host header. |
| 121 | """ |
| 122 | if "skip_host" in kwargs: |
| 123 | raise NotImplementedError("`skip_host` isn't supported") |
| 124 | if "skip_accept_encoding" in kwargs: |
| 125 | raise NotImplementedError("`skip_accept_encoding` isn't supported") |
| 126 | |
| 127 | self._request_url = url or "/" |
| 128 | self._validate_path(url) # type: ignore[attr-defined] |
| 129 | |
| 130 | if ":" in self.host: |
| 131 | authority = f"[{self.host}]:{self.port or 443}" |
| 132 | else: |
| 133 | authority = f"{self.host}:{self.port or 443}" |
| 134 | |
| 135 | self._headers.append((b":scheme", b"https")) |
| 136 | self._headers.append((b":method", method.encode())) |
| 137 | self._headers.append((b":authority", authority.encode())) |
| 138 | self._headers.append((b":path", url.encode())) |
| 139 | |
| 140 | with self._h2_conn as conn: |
| 141 | self._h2_stream = conn.get_next_available_stream_id() |
| 142 | |
| 143 | def putheader(self, header: str | bytes, *values: str | bytes) -> None: # type: ignore[override] |
| 144 | # TODO SKIPPABLE_HEADERS from urllib3 are ignored. |
no outgoing calls