Message235166
Currently the documentation gives the impression that the “data” parameter to Request() has to be in the application/x-www-form-urlencoded format. However I suspect that you can override the type by supplying a Content-Type header, and I would like to document this; see uploaded patch.
I noticed that test_urllib2.HandlerTests.test_http() already seems to test the default Content-Type and a custom Content-Type with a Request() object, although I did not see a test for the default Content-Type when supplying “data” directly to urlopen().
Also I understand the “charset” parameter on application/x-www-form-urlencoded is not standardized. Would it correspond to the encoding of the %XX codes from urlencode(), which is typically UTF-8, not Latin-1? Or would it correspond to the subsequent string-to-bytes encoding stage, which could just be ASCII since non-ASCII characters are already encoded? Maybe it would be best to drop the advice to set a “charset” parameter. It was added for Issue 11082. |
|
Date |
User |
Action |
Args |
2015-02-01 12:43:32 | martin.panter | set | recipients:
+ martin.panter, docs@python |
2015-02-01 12:43:32 | martin.panter | set | messageid: <1422794612.5.0.505084736818.issue23360@psf.upfronthosting.co.za> |
2015-02-01 12:43:32 | martin.panter | link | issue23360 messages |
2015-02-01 12:43:32 | martin.panter | create | |
|