reference: https://golang.org/doc/tutorial/web-service-gin
go run .
- GET /albums
- You can get list of albums.
- GET /albums/:id
- You can get information about a single album.
- POST /albums
- You can add new album.
$ curl http://localhost:8080/albums
$ curl http://localhost:8080/albums/2
$ curl http://localhost:8080/albums \
--include \
--header "Content-Type: application/json" \
--request "POST" \
--data '{"id": "4","title": "The Modern Sound of Betty Carter","artist": "Betty Carter","price": 49.99}'
In this project, there is no DB. So, result of this post
method is only applied temporarily.