Introduction
This repository stores a Postman collection to test the APIs.
Steps
- Import the Collection into Postman.
- Ensure that the URL has the value as seen in the
Route
object. - Run the
POST
request to add a new customer to the databse.- You may change values in the request body.
- Note the key value returned in
message
object of the response body.
- Run the
GET
request with customer ID as received inPOST
request.- The result should be same as the one used in
POST
.
- The result should be same as the one used in
- Run the
PUT
request with customer ID as received inPOST
request.- You may change values in the request body.
- Run the
GET
request with customer ID as received inPOST
request.- The result should be same as the one used in
PUT
.
- The result should be same as the one used in
- Run the
DELETE
request with customer ID as received inPOST
request. - Run the
GET
request with customer ID as received inPOST
request.- The result should be a response with HTTP status code
404
.
- The result should be a response with HTTP status code
curl
commands
Equivalent - Ensure that the URL has the value as seen in the
Route
object. - Add a customer
curl -X POST http://custdemo-apis-custdemo.192.168.99.100.nip.io/customers -d '{"name":"OpenShiftDemo","address":"Hebbala, Bengaluru, INDIA"}'
- Get a customer
- Replace
customerId
below with the ID returned in thePOST
request.
- Replace
curl -X GET http://custdemo-apis-custdemo.192.168.99.100.nip.io/customer/customerId
- Edit details of a customer
- Replace
customerId
below with the ID returned in thePOST
request.
- Replace
curl -X PUT http://custdemo-apis-custdemo.192.168.99.100.nip.io/customer/customerId -d '{"name":"OpenShiftDemo","address":"Indiranagara, Bengaluru, INDIA"}'
- Remove of a customer
- Replace
customerId
below with the ID returned in thePOST
request.
- Replace
curl -X DELETE http://custdemo-apis-custdemo.192.168.99.100.nip.io/customer/customerId