Message363502
| Author |
henrik242 |
| Recipients |
henrik242 |
| Date |
2020年03月06日.11:45:27 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> |
| In-reply-to |
| Content |
curl correctly posts data to Solr:
$ curl -v 'http://solr.example.no:12699/solr/my_coll/update?commit=true' \
--data '<add><doc><field name="key">KEY__9927.1</field><field name="value">\
{"result":0,"jobId":"9459695","jobNumber":"9927.1"}</field></doc></add>'
The solr query log says:
[20200306T111354,131] [my_coll_shard1_replica_n85] webapp=/solr path=/update params={commit=true} status=0 QTime=96
I'm trying to do the same thing with Python:
>>> import urllib.request
>>> data='<add><doc><field name="key">KEY__9927.1</field><field name="value">{"result":0,"jobId":"9459695","jobNumber":"9927.1"}</field></doc></add>'
>>> url='http://solr.example.no:12699/solr/my_coll/update?commit=true'
>>> req = urllib.request.Request(url=url, data=data.encode('utf-8'), method='POST')
>>> res = urllib.request.urlopen(req)
But now the solr query log shows that the POST data has been added to the query param string:
[20200306T112358,780] [my_coll_shard1_replica_n87] webapp=/solr path=/update params={commit=true&<add><doc><field+name="key">KEY__9927.1</field><field+name%3D"value">{"result":0,"jobId":"9459695","jobNumber":"9927.1"}</field></doc></add>} status=0 QTime=30
What is happening here?
$ python3 -VV
Python 3.7.6
(default, Dec 30 2019, 19:38:26)
[Clang 11.0.0 (clang-1100033.16)] |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2020年03月06日 11:45:28 | henrik242 | set | recipients:
+ henrik242 |
| 2020年03月06日 11:45:28 | henrik242 | set | messageid: <1583495128.12.0.395255556414.issue39875@roundup.psfhosted.org> |
| 2020年03月06日 11:45:28 | henrik242 | link | issue39875 messages |
| 2020年03月06日 11:45:27 | henrik242 | create |
|