Skip to content
Snippets Groups Projects
Commit 7baf4a63 authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

fixes documentation.

parent 258f02f9
No related branches found
No related tags found
No related merge requests found
......@@ -12,40 +12,45 @@ mvn clean verify && \
Get a Hello message
```shell
curl -v http://127.0.0.1:9998/myapp/biblio
curl -s -D - http://localhost:9998/myapp/biblio
```
Init the database with two authors
```shell
curl -v -X PUT "http://localhost:9998/myapp/biblio/init"
curl -s -D - -X PUT "http://localhost:9998/myapp/biblio/init"
```
Get author 1 in JSON
```shell
curl -v -H "Accept: application/json" \
http://127.0.0.1:9998/myapp/biblio/auteurs/1
curl -s -D - -H "Accept: application/json" \
http://localhost:9998/myapp/biblio/auteurs/1
```
Get author 2 in XML
```shell
curl -v -H "Accept: text/xml" \
http://127.0.0.1:9998/myapp/biblio/auteurs/2
curl -s -D - -H "Accept: text/xml" \
http://localhost:9998/myapp/biblio/auteurs/2
```
Get authors in JSON
```shell
curl -v -H "Accept: application/json" \
http://127.0.0.1:9998/myapp/biblio/auteurs
curl -s -D - -H "Accept: application/json" \
http://localhost:9998/myapp/biblio/auteurs
```
Removes an author
```shell
curl -s -D - -X DELETE "http://localhost:9998/myapp/biblio/authors/1"
```
Removes all authors
```shell
curl -v -X DELETE "http://localhost:9998/myapp/biblio/authors"
curl -s -D - -X DELETE "http://localhost:9998/myapp/biblio/authors"
```
Adds an author
```shell
curl -v -H "Accept: application/json" \
curl -s -D - -H "Accept: application/json" \
-H "Content-type: application/json" \
-X POST \
-d '{"nom":"John","prenom":"Smith","biographie":"My life"}' \
......@@ -54,7 +59,7 @@ curl -v -H "Accept: application/json" \
Fully update an author
```shell
curl -v -H "Accept: application/json" \
curl -s -D - -H "Accept: application/json" \
-H "Content-type: application/json" \
-X PUT \
-d '{"nom":"Martin","prenom":"Jean","biographie":"ma vie"}' \
......@@ -63,7 +68,7 @@ curl -v -H "Accept: application/json" \
If a resource doesn't exist an exception is raised, and the 404 http status code is returned
```shell
curl -v -H "Accept: application/json" \
http://127.0.0.1:9998/myapp/biblio/auteurs/1000
curl -s -D - -H "Accept: application/json" \
http://localhost:9998/myapp/biblio/auteurs/1000
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment