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

Backports PR #10086

**Commit 1:**
[console] Add content-type when using copy as curl

* Original sha: a23ae3bc3f
* Authored by Jonathan Budzenski <jon@jbudz.me> on 2017-01-26T22:27:39Z
This commit is contained in:
jasper 2017-02-07 09:45:02 -05:00 committed by Jonathan Budzenski
parent 9ed7e81b62
commit 4d1e3129fb
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()