Using the Go docs tutorial
-
Run the app with
go run .
-
In another terminal window, run the following
curl
commands to make requests to the web service:GET all albums
$ curl http://localhost:8080/albums
POST add new album
$ 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}'
GET album by
/id
$ curl http://localhost:8080/albums/2