diff --git a/HowtocURL.md b/HowtocURL.md index 3853f369..2ea64059 100644 --- a/HowtocURL.md +++ b/HowtocURL.md @@ -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 : ~~~