Ajout de l'option --json
This commit is contained in:
parent
06a59812fc
commit
2eceffd267
18
HowtocURL.md
18
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 :
|
||||
|
||||
~~~
|
||||
|
|
Loading…
Reference in a new issue