Try adding this header argument after your curl command:
-H "Content-Type: application/json"
Tim
I have an XML doc that I am parsing that results in 5M
documents. I have been successful in serializing this and
writing to the database but this takes an extremely long time.
As a result, I am testing the _bulk_docs import but have not
been successful.
Below is a snapshot of the file that I am creating to do the
bulk import, but when I use it, I get the following error:
>curl -X POST -d @bulk.json
http://192.168.1.133:5984/bulktest/_bulk_docs
>{"error":"bad_content_type","reason":"Content-Type must be
application/json"}
bulk.json
{
"docs": [
{ "session_id":"849", "policyID":"trust-to-untrust/4",
"in_srcIP":"192.168.199.108", "in_srcPort":"49174",
"in_dstIP":"72.14.213.109", "in_dstPort":"993",
"out_srcIP":"72.14.213.109", "out_srcPort":"993",
"out_dstIP":"98.207.50.174", "out_dstPort":"38324",
"protocol":"tcp" },
{ "session_id":"2127", "policyID":"trust-to-untrust/4",
"in_srcIP":"192.168.199.117", "in_srcPort":"49197",
"in_dstIP":"17.148.16.38", "in_dstPort":"993",
"out_srcIP":"17.148.16.38", "out_srcPort":"993",
"out_dstIP":"98.207.50.174", "out_dstPort":"27540",
"protocol":"tcp" },
{ "session_id":"2364", "policyID":"trust-to-untrust/4",
"in_srcIP":"192.168.199.117", "in_srcPort":"49309",
"in_dstIP":"98.136.48.116", "in_dstPort":"5050",
"out_srcIP":"98.136.48.116", "out_srcPort":"5050",
"out_dstIP":"98.207.50.174", "out_dstPort":"38335",
"protocol":"tcp" },
]
}