当前位置:网站首页>Instance setup flask service (simple version)
Instance setup flask service (simple version)
2022-07-29 03:31:00 【Doraemon's pocket】
python Write the following code in the file :(get_data_flask_server.py)
import sys
from flask.globals import request
from flask import Flask
app_flask = Flask(__name__)
@app_flask.route('/get_data', methods=['GET'])
def get_data():
# Get request parameters
tid = request.args.get("tid")
token = request.args.get("token")
data = {
}
# To write data Get logic , Examples are as follows :
data = {
"tid": tid,"token": token}
return data
if __name__ == '__main__':
# Start the service , The port number can be modified by itself , Devices under the same LAN can also be accessed
app_flask.run(host='0.0.0.0', port=20887)
Start the service :python get_data_flask_server.py
If the machine that starts the service ip yes 1.2.3.4, Then the browser can access the following links to obtain data :http://1.2.3.4:20887/get_data?tid=12345&token=abcdefg123456789
边栏推荐
- ShardingSphere之水平分表实战(三)
- Production deployment zabbix5.0 notes
- [technology 1]
- Naive Bayes -- continuous data
- Web uploader cannot upload multiple files
- Three military product baselines (functional baseline, distribution baseline, product baseline) and the documents contained in the baseline
- Score addition and subtraction of force deduction and brushing questions (one question per day 7/27)
- July 28, 2022 Gu Yujia's study notes
- Sanzi chess (player + computer)
- 最新二开版漫画小说听书三合一完整源码/整合免签接口/搭建教程/带采集接口
猜你喜欢
Bingbing learning notes: operator overloading -- implementation of date class
C language programming | exchange binary odd and even bits (macro Implementation)
Introduction to JVM foundation I (memory structure)
STC单片机驱动1.8‘TFT SPI屏幕演示示例(含资料包)
最新二开版漫画小说听书三合一完整源码/整合免签接口/搭建教程/带采集接口
makefile详解
Summary of basic knowledge points of C language
Redis之sentinel哨兵集群怎么部署
机器学习【Numpy】
Whole process record of yolov3 target detection
随机推荐
exness:鸽派决议帮助黄金反弹,焦点转向美国GDP
Web uploader cannot upload multiple files
04 | background login: login method based on account and password (Part 1)
Use of leak scanning (vulnerability scanning) tool burpsuite or burp Suite (with installation and installation package download of burpsuite+1.7.26)
GJB常见混淆概念
Machine learning based on deepchem
AI platform, AI midrange architecture
Photo scale correction tool: DxO viewpoint 3 direct mount version
Several methods of converting object to string
web-uploader不能多文件上传
Simple code implementation of K-means clustering
Flask creation process day05-06 creation project
后缀自动机(sam)板子 from jly
正则表达绕过waf
Redis之sentinel哨兵集群怎么部署
Practical application cases of digital Twins - smart energy
Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it
Makefile details
Multi level wavelet CNN for image restoration
MYCAT read / write separation configuration