Ajout de l'option --json

This commit is contained in:
jlecour 2023-12-22 09:21:52 +01:00
parent 06a59812fc
commit 2eceffd267

View file

@ -165,15 +165,19 @@ Pour tester des interactions avec une API REST, on peut facilement envoyer des s
En direct :
~~~
$ curl -XPUT 'http://localhost:9200/_snapshot/foo' -d '{
"type": "fs",
"settings": {
"location": "/home/backup-elasticsearch",
"compress": true
}
}'
$ curl -XPUT 'http://localhost:9200/_snapshot/foo' \
--header "Content-Type: application/json"\
--header "Accept: application/json"\
--data '{"foo": "bar"}'
~~~
Les versions récentes de curl supportent même l'option `--json` :
~~~
$ curl -XPUT 'http://localhost:9200/_snapshot/foo' --json '{"foo": "bar"}'
~~~
Via un fichier :
~~~