[console] Add content-type when using copy as curl

This commit is contained in:
Jonathan Budzenski 2017-01-26 16:27:39 -06:00
parent d41b31db4d
commit a23ae3bc3f
No known key found for this signature in database
GPG key ID: D28BF9418FA0F292
2 changed files with 2 additions and 2 deletions

View file

@ -546,7 +546,7 @@ function SenseEditor($el) {
var ret = 'curl -X' + es_method + ' "' + url + '"';
if (es_data && es_data.length) {
ret += " -d'\n";
ret += " -H 'Content-Type: application/json' -d'\n";
var data_as_string = utils.collapseLiteralStrings(es_data.join("\n"))
// since Sense doesn't allow single quote json string any single qoute is within a string.
ret += data_as_string.replace(/'/g, '\\"');

View file

@ -386,7 +386,7 @@ curl -XGET "http://localhost:9200/_stats?level=shards"
#in between comment
curl -XPUT "http://localhost:9200/index_1/type1/1" -d'
curl -XPUT "http://localhost:9200/index_1/type1/1" -H 'Content-Type: application/json' -d'
{
"f": 1
}'`.trim()