Skip to content

Commit

Permalink
Always capitalize http methods, add missing PATCH method to type literal
Browse files Browse the repository at this point in the history
  • Loading branch information
perklet committed Aug 2, 2024
1 parent b8f2747 commit 45ab712
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion curl_cffi/requests/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class BaseSessionParams(TypedDict, total=False):
BaseSessionParams = TypedDict

ThreadType = Literal["eventlet", "gevent"]
HttpMethod = Literal["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD", "TRACE"]
HttpMethod = Literal["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD", "TRACE", "PATCH"]


def _is_absolute_url(url: str) -> bool:
Expand Down Expand Up @@ -382,6 +382,8 @@ def _set_curl_options(
):
c = curl

method = method.upper() # type: ignore

# method
if method == "POST":
c.setopt(CurlOpt.POST, 1)
Expand Down

0 comments on commit 45ab712

Please sign in to comment.