bpo-36064: Clarify allowed data types for urllib.request.Request. (GH… · python/cpython@9e30fba

Original file line numberDiff line numberDiff line change

@@ -192,8 +192,8 @@ The following classes are provided:

192192

*data* must be an object specifying additional data to send to the

193193

server, or ``None`` if no such data is needed. Currently HTTP

194194

requests are the only ones that use *data*. The supported object

195-

types include bytes, file-like objects, and iterables. If no

196-

``Content-Length`` nor ``Transfer-Encoding`` header field

195+

types include bytes, file-like objects, and iterables of bytes-like objects.

196+

If no ``Content-Length`` nor ``Transfer-Encoding`` header field

197197

has been provided, :class:`HTTPHandler` will set these headers according

198198

to the type of *data*. ``Content-Length`` will be used to send

199199

bytes objects, while ``Transfer-Encoding: chunked`` as specified in