...
Create a JSON file named
request.json
with the following request payload.Code Block { "name": "John Doe", "dob": "1940-03-19", "ssn": "234-23-525", "address": "California", "phone": "8770586755", "email": "johndoe@gmail.com", "doctor": "thomas collins", "hospital": "grand oak community hospital", "cardNo": "7844481124110331", "appointment_date": "2025-04-02" }
Open a command line terminal and execute the following command from the location where the
request.json
file was saved:Code Block curl -v -X POST --data @request.json http://localhost:8280/healthcare/categories/surgery/reserve --header "Content-Type:application/json"
Info This is derived from the URI-Template defined when creating the API resource.
http://<host>:<port>/categories/{category}/reserve
You will see the response as follows:
Code Block { "appointmentNo":1, "doctorName":"thomas collins", "patient":"John Doe", "actualFee":7000.0, "discount":20, "discounted":5600.0, "paymentID":"480fead2-e592-4791-941a-690ad1363802", "status":"Settled" }
...