Add headers to the sample curl (#63548) (#63861)

* Add headers to the sample curl

At least in 7.x it doesn't work without the kbn-xsrf and json headers.

* More headers to curl commands

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Radu Gheorghe <radu.gheorghe@sematext.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Kaarina Tungseth 2020-04-17 10:17:33 -05:00 committed by GitHub
parent f2c0e69dbc
commit 3fc33a3e8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View file

@ -59,12 +59,12 @@ any data that you send to the API is properly formed.
[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/index-pattern/my-pattern"
$ curl -X POST "localhost:5601/api/saved_objects/index-pattern/my-pattern" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"attributes": {
"title": "my-pattern-*"
}
}
}'
--------------------------------------------------
// KIBANA

View file

@ -68,10 +68,10 @@ Export all index pattern saved objects:
[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export"
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"type": "index-pattern"
}
}'
--------------------------------------------------
// KIBANA
@ -79,11 +79,11 @@ Export all index pattern saved objects and exclude the export summary from the s
[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export"
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"type": "index-pattern",
"excludeExportDetails": true
}
}'
--------------------------------------------------
// KIBANA
@ -91,7 +91,7 @@ Export a specific saved object:
[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export"
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"objects": [
{
@ -99,7 +99,7 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export"
"id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
}
]
}
}'
--------------------------------------------------
// KIBANA
@ -107,7 +107,7 @@ Export a specific saved object and it's related objects :
[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export"
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"objects": [
{
@ -116,6 +116,6 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export"
}
],
"includeReferencesDeep": true
}
}'
--------------------------------------------------
// KIBANA