[issue39875] urllib.request.urlopen sends POST data as query string

henrik242 report at bugs.python.org
Fri Mar 6 09:44:41 EST 2020


henrik242 <henrik at synth.no> added the comment:

Here's the wireshark output.  It seems that urllib adds a "Connection: close" which curl doesn't.  Solr doesn't seem to like that.


Curl message:

POST /solr/my_coll/update?commit=true HTTP/1.1
Host: solr.example.no:12699
User-Agent: curl/7.64.1
Accept: */*
Content-Length: 138
Content-Type: application/x-www-form-urlencoded

<add><doc><field name="key">KEY__9927.1</field><field name="value">{"result":0,"jobId":"9459695","jobNumber":"9927.1"}</field></doc></add>


Python message:

POST /solr/my_coll/update?commit=true HTTP/1.1
Accept-Encoding: identity
Content-Type: application/x-www-form-urlencoded
Content-Length: 138
Host: solr.example.no:12699
User-Agent: Python-urllib/3.7
Connection: close

<add><doc><field name="key">KEY__9927.1</field><field name="value">{"result":0,"jobId":"9459695","jobNumber":"9927.1"}</field></doc></add>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39875>
_______________________________________


More information about the Python-bugs-list mailing list