Advertisement
zero_shubham1

soumi

Dec 6th, 2020
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from flask import Flask
  2. from flask import request
  3. app = Flask(__name__)
  4.  
  5.  
  6. @app.route('/')
  7. def hello_world():
  8.     return 'Hello, World!'
  9.  
  10.  
  11. @app.route('/lists', methods=["POST"])
  12. def list_post():
  13.     json_body = request.get_json()
  14.     print(json_body)
  15.    
  16.     # * this is show query params needs to parsed manually
  17.     print((request.query_string).decode("utf-8"))
  18.     return {
  19.         "resp": [1, 2, 3]
  20.     }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement