Skip to content

Instantly share code, notes, and snippets.

@rightson
Last active April 22, 2018 12:05
Show Gist options
  • Save rightson/9095dab540d81bcc6f5fd8d96e075612 to your computer and use it in GitHub Desktop.
Save rightson/9095dab540d81bcc6f5fd8d96e075612 to your computer and use it in GitHub Desktop.
simple flask
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/store' , methods=['POST'])
def create_store():
print(request.data)
print(request.get_json())
return 'haha'
app.run(port=5000, host='0.0.0.0', debug=True)
'''
Example client:
import requests
requests.post('http://140.113.216.88:5000/store', json={'ip': 'xxx', 'bw': 35555})
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment