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 : En direct :
~~~ ~~~
$ curl -XPUT 'http://localhost:9200/_snapshot/foo' -d '{ $ curl -XPUT 'http://localhost:9200/_snapshot/foo' \
"type": "fs", --header "Content-Type: application/json"\
"settings": { --header "Accept: application/json"\
"location": "/home/backup-elasticsearch", --data '{"foo": "bar"}'
"compress": true
}
}'
~~~ ~~~
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 : Via un fichier :
~~~ ~~~