Michael C.H. Wang
Michael C.H. Wang

Reputation: 97

Incorrect curl Post syntax for Elasticsearch in Postman

I'm a new learned and follow AWS example here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-gsg-upload-data.html to build my first elasticsearch application. I'm using Postman for curl command POST to append new document and index as shown here. However it seems the syntax is incorrect highlight by Postman so see if support to correct, thank you! curl code for Post in postman

updated

enter image description here

Upvotes: 1

Views: 531

Answers (1)

Val
Val

Reputation: 217274

If you're posting to the _bulk URL, then the lines 1 through 6 should be on a single line without newlines. Same for lines 7 and 8. And you need to add a single newline at the end. Like this:

{ "index": {"_index": "movies", "_type": "movie", "_id": "2" }}
{ "director": "...", ...}     + add a new line at the end of this line

Upvotes: 1

Related Questions