Skip to content

Commit

Permalink
Cleanup Request method parameter. (#3378)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie authored Oct 29, 2024
1 parent 12be5c4 commit 6622553
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 2 additions & 6 deletions httpx/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def __repr__(self) -> str:
class Request:
def __init__(
self,
method: str | bytes,
method: str,
url: URL | str,
*,
params: QueryParamTypes | None = None,
Expand All @@ -323,11 +323,7 @@ def __init__(
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
Expand Down

0 comments on commit 6622553

Please sign in to comment.