Search code examples
pythonjsonhttpsserverget

Building a web service for processing Json data with python


I am only told to create a pythonic web service. At the end of the day, I need to offer a HTTPS endpoint which will receive(from a post request), and be able to process/send back json objects from/to another web service.

To be able to receive post requests from other services, what kind of information do I need?

I have seen some examples using httplib2 such as sending HTTP get and post requests when given a website like www.something.com. But in my case, since I do not know the IP address/URL of the data source, should I create a listener waiting for the incoming data? How to achieve this?

I am really new with building python web server and the requirement I am given is really vague. Thank you in advance for helping me break down this problem.


Solution

  • Take a look at the Flask framework, it can do everything you want and then some. I can especially recommend the Quickstart: A Minimal Application and the JSON Support pages.

    Enabling the build in debugger will help you a great deal as well.

    All services is listening for incoming connections, so you are right about that :-)

    Good luck!