Last active
April 22, 2018 12:05
-
-
Save rightson/9095dab540d81bcc6f5fd8d96e075612 to your computer and use it in GitHub Desktop.
simple flask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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