diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index 95e4d2627c8b23b..5729ec95c8e4f1c 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -1055,6 +1055,11 @@ AbstractBasicAuthHandler Objects authority must not contain a userinfo component (so, ``"python.org"`` and ``"python.org:80"`` are fine, ``"joe:password@python.org"`` is not). + Headers object can be created as follows:: + + import email + headers = email.message.Message() + headers['Content-type'] = 'text/plain' .. _http-basic-auth-handler: diff --git a/Misc/NEWS.d/next/Library/2022-01-22-19-16-35.bpo-45572.xPfsg5.rst b/Misc/NEWS.d/next/Library/2022-01-22-19-16-35.bpo-45572.xPfsg5.rst new file mode 100644 index 000000000000000..b933e9254ffd8f7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-01-22-19-16-35.bpo-45572.xPfsg5.rst @@ -0,0 +1,2 @@ +Documented *headers* parameter for +:func:`urllib.request.http_error_auth_reqed`.