curl -s -XPOST localhost:9200/_bulk --data-binary @filename.json
I am looking at RestClient gem and cant figure out how to do this. I need this for making a bulk request to elasticsearch.
Using rest-client
RestClient.post 'localhost:9200/_bulk', File.new("filename.json", 'rb'), 'Content-type' => 'application/x-www-form-urlencoded'
not sure if rest-client
automatically set content-type
, just check without it.