Ezio Melotti added the comment:

> For the request data, the question is what types do we currently support?

This is what I was wondering as well.  The doc says "data must be a bytes 
object specifying additional data to send to the server, or None if no such 
data is needed."[0]
However one of the error messages says "POST data should be bytes or an 
iterable of bytes." and "Content-Length should be specified for iterable data" 
so iterables of bytes also seem to be supported.
One option is to simply reject str and dict (or mappings in general), since 
these seem to me the two most likely errors (the first in case the user forgot 
to encode the output of urlencode(), the second in case the user forgot 
urlencode() altogether and passed a dict).

[0]: 
https://docs.python.org/3/library/urllib.request.html#urllib.request.Request

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25439>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to