From 00483b63e6c79263b7eece290793bcb0c17eba84 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 2 Dec 2022 10:49:33 -0800 Subject: [PATCH] http.client.HTTPConnection.request accepts str as the body (#9322) See code around https://github.com/python/cpython/blob/ab02262cd0385a2fb5eb8a6ee3cedd4b4bb969f3/Lib/http/client.py#L1328 --- stdlib/http/client.pyi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index ad794ed9b..53cefc0a3 100644 --- a/stdlib/http/client.pyi +++ b/stdlib/http/client.pyi @@ -154,7 +154,13 @@ class HTTPConnection: blocksize: int = ..., ) -> None: ... def request( - self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ... + self, + method: str, + url: str, + body: _DataType | str | None = ..., + headers: Mapping[str, str] = ..., + *, + encode_chunked: bool = ..., ) -> None: ... def getresponse(self) -> HTTPResponse: ... def set_debuglevel(self, level: int) -> None: ...