This is the most simplified form of a RESTful-API using the Flask microframework.
- Install requirements
$ pip install -r requirements.txt
- Run the server.py file.
$ python server.py
- Call the endpoints specified for the server.
- You can use POSTMAN to test the api.
- Server output:
127.0.0.1 - [28/Apr/2019 17:31:54] "GET /employee/testGet HTTP/1.1" 200 127.0.0.1 - [28/Apr/2019 17:31:54] "POST /employee/testPost HTTP/1.1" 200 127.0.0.1 - [28/Apr/2019 17:31:54] "PUT /employee/testPut HTTP/1.1" 200 127.0.0.1 - [28/Apr/2019 17:31:54] "PATCH /employee/testPatch HTTP/1.1" 200 127.0.0.1 - [28/Apr/2019 17:31:54] "DELETE /employee/testDelete HTTP/1.1" 200
- localhost:5000/employee/<employee_name>
- This endpoint support the follwonig Http requests:
- GET
- POST
- PUT
- PATCH
- DELETE
- This endpoint require a single parameter to be passed <employee_name>.
- This endpoint support the follwonig Http requests:
- Flask uses port number 5000 as the default port.
- Each Http request has its own handler, which must be implemented by the developer inside the server.py file.
We use Github for versioning. For the versions available, see the tags on this repository.
- Ibrahim Almohaimeed - Github account
This project is licensed under the MIT License - see LICENSE for details.