- Python 2.7
- flask
- json
- hashlib
- copy
-
Make sure that all the dependancies are installed.
-
Run the flask app by the following command
$ python run.py
-
This will start the app on localhost and you can check the API calls using curl or postmaster.
-
Sample curl request
$ curl -i http://localhost:5000/doctors
-
Get all doctors
HTTP Method :
GET
URI :
API_endpoint/doctors/
-
Get a doctor
HTTP Method : GET
URI : API_endpoint/doctors/<doctor_id>/
-
Create a doctor
-
HTTP Method :
POST
-
URI :
API_endpoint/doctors/
-
Body : json in the following properties.
- name (Name of the Doctor)
- qualifications (Qualifations of the doctor)
- contact (Contact number for doctor)
- city (City where doctor is)
- location (Locality in the area)
-
-
Update a doctor
-
HTTP Method :
PUT
-
URI :
API_endpoint/doctors/<doctor_id>/
-
body: json with any of the property to change
-
-
Delete a doctor
-
HTTP Method :
DELETE
-
URI :
API_endpoint/doctors/<doctor_id>/
-