Skip to content

Latest commit

 

History

History
51 lines (43 loc) · 724 Bytes

README.md

File metadata and controls

51 lines (43 loc) · 724 Bytes

Kapitel 4: HTTP und JSON

Start

cd kapitel04
go run main.go

URIs

GET /contacts

curl -X GET \
  http://localhost:8080/contacts \
  -H 'cache-control: no-cache' 

GET /contacts/{id}

curl -X GET \
  http://localhost:8080/contacts/1

POST /contacts

curl -X POST \
  http://localhost:8080/contacts \
  -H 'Content-Type: application/json' \
  -d '{
    "Firstname": "Kater",
    "Lastname": "Kalle"
}'

DELETE /contacts/{id}

curl -X DELETE \
  http://localhost:8080/contacts/1

PUT /contacts/{id}

curl -X PUT \
  http://localhost:8080/contacts/1 \
  -H 'Content-Type: application/json' \
  -d '{
    "Firstname": "Jens",
    "Lastname": "Wirdemann"
}'