擅长:python、mysql、java
<p><strong>试试这样的方法:</strong></p>
<pre><code>import requests
import json
headers = {
'Content-Type': 'application/x-ndjson',
}
params = (('pretty', ''),)
data = open('file.json', 'rb').read()
response = requests.post('http://192.168.1.149:9200/shakespeare/doc/_bulk', headers=headers, params=params, data=data)
print(response.text)
</code></pre>
<p><strong>注意:</strong>根据curl命令,这只是一个示例。你知道吗</p>
<p>谢谢!希望对你有帮助!:)</p>