RESTful APIs with Python and Flask : Part 2
Hello Friends, Welcome back !!! In my last blog we saw that how we can setup a RESTful API using Python and Flask framework. We also learned how to pass request params from client to the API call and receive it at server side. Continuation on the same, today we are going to learn how to create POST API call and pass the JSON request to it. We'll use a tool call POSTMAN to hit the POST API. If you don't have it, you can install it from below link - https://www.postman.com/downloads/ Ok, let's get started. I am assuming that you have already gone through my earlier blog and have created the directory structure for this project. If not, then please go through it and create the app.py file. https://diwakarsinhalearn.blogspot.com/2021/02/restful-apis-with-python-and-flask-part.html Step 01 : In the app.py file, please add the below code. @app.route ( "/employee" , methods =[ "POST" ]) def employee(): data = request.get_json() if data: name =...