-
Notifications
You must be signed in to change notification settings - Fork 0
/
curl.example
13 lines (11 loc) · 827 Bytes
/
curl.example
1
2
3
4
5
6
7
8
9
10
11
12
13
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
grpcurl -plaintext -d '{"name": "foo", "price": 10.20}' localhost:8080 product.v1.ProductService/AddProduct
grpcurl -plaintext -d '{"name": "bar", "price": 5.10}' localhost:8080 product.v1.ProductService/AddProduct
grpcurl -plaintext -d '{}' localhost:8080 product.v1.ProductService/ListProducts
grpcurl -plaintext -d '{"product_id": "<ID do foo>"}' localhost:8080 product.v1.ProductService/DeleteProduct
grpcurl -plaintext -d '{}' localhost:8080 product.v1.ProductService/ListProducts
curl -X POST -d '{"name": "foo", "price": 10.20}' localhost:8081/api/v1/add
curl -X POST -d '{"name": "bar", "price": 5.10}' localhost:8081/api/v1/add
curl localhost:8081/api/v1/list
curl -X DELETE "localhost:8081/api/v1/delete/<ID do foo>"
curl localhost:8081/api/v1/list