Curl post command issue

Error:

1)

curl -H ‘Content-Type:¬† application/x-ndjson’ -XPOST ‘localhost:9200/bank/account/_bulk?pretty’ –data-binary @accounts.json

Working: (remove the space after “Content-Type:”)

http not support error

curl -H ‘Content-Type: application/x-ndjson’ -XPOST ‘localhost:9200/bank/account/_bulk?pretty’ –data-binary @accounts.json

correct syntax for windows  (change single quote to double quote)

curl -H ‘Content-Type:application/x-ndjson’ -XPOST ‘http://localhost:9200/bank/account/_bulk?pretty’ –data-binary @C:\BDS\KibanaData\accounts.json

right:

curl -H “Content-Type:application/x-ndjson” -XPOST “http://localhost:9200/bank/account/_bulk?pretty” –data-binary @C:\BDS\KibanaData\accounts.json

and it works!

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *