]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Cleanup `Request` method parameter. (#3378)
authorTom Christie <tom@tomchristie.com>
Tue, 29 Oct 2024 15:31:31 +0000 (15:31 +0000)
committerGitHub <noreply@github.com>
Tue, 29 Oct 2024 15:31:31 +0000 (15:31 +0000)
CHANGELOG.md
httpx/_models.py

index 460e315422a58a2597411f469f475e03bc3ea493..d3b109a8d3901dcd45d44b72dd27b8cff70b4dec 100644 (file)
@@ -17,6 +17,7 @@ This release introduces an `httpx.SSLContext()` class and `ssl_context` paramete
 * Review URL percent escape sets, based on WHATWG spec. (#3371, #3373)
 * Ensure `certifi` and `httpcore` are only imported if required. (#3377)
 * Treat `socks5h` as a valid proxy scheme. (#3178)
+* Cleanup `Request()` method signature in line with `client.request()` and `httpx.request()`. (#3378)
 
 ## 0.27.2 (27th August, 2024)
 
index 2ff22b487685d5c7e12b5b9a152e97fd17f72cac..c59f0196d3278b71de17e2959f041719563951ae 100644 (file)
@@ -310,7 +310,7 @@ class Headers(typing.MutableMapping[str, str]):
 class Request:
     def __init__(
         self,
-        method: str | bytes,
+        method: str,
         url: URL | str,
         *,
         params: QueryParamTypes | None = None,
@@ -323,11 +323,7 @@ class Request:
         stream: SyncByteStream | AsyncByteStream | None = None,
         extensions: RequestExtensions | None = None,
     ) -> None:
-        self.method = (
-            method.decode("ascii").upper()
-            if isinstance(method, bytes)
-            else method.upper()
-        )
+        self.method = method.upper()
         self.url = URL(url) if params is None else URL(url, params=params)
         self.headers = Headers(headers)
         self.extensions = {} if extensions is None else extensions