[console] Add content-type when using copy as curl (#10086)

This commit is contained in:
Jonathan Budzenski 2017-02-07 08:19:24 -06:00 committed by GitHub
parent 142a9b8b1e
commit 372185a166
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()