当前位置:网站首页>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
边栏推荐
- Realize multi-level linkage through recursion
- 反脆弱·从不确定性中获益---管理?
- 3D advanced renderer: artlandis studio 2021.2 Chinese version
- How dare you write a resume that is proficient in concurrent programming? Why do you use a two-way linked list in AQS?
- Practical application cases of digital Twins - smart energy
- Simple understanding of CDN, SDN and QoS
- How close can QA be to business code Direct exposure of defects through codediff
- Learn more than 4000 words, understand the problem of this pointing in JS, and handwrite to realize call, apply and bind
- Score addition and subtraction of force deduction and brushing questions (one question per day 7/27)
- C language programming | exchange binary odd and even bits (macro Implementation)
猜你喜欢

Summary of basic knowledge points of C language

Example analysis of while, repeat and loop loops in MySQL process control

Sleuth+zipkin to track distributed service links

3D advanced renderer: artlandis studio 2021.2 Chinese version

ROS-Errror:Did you forget to specify generate_ messages(DEPENDENCIES ...)?

Configure vscade to realize ROS writing

C language programming | exchange binary odd and even bits (macro Implementation)

Use of leak scanning (vulnerability scanning) tool burpsuite or burp Suite (with installation and installation package download of burpsuite+1.7.26)

Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it

【科技1】
随机推荐
LeetCode 1331 数组序号转换[Map] HERODING的LeetCode之路
Tonight at 7:30 | is the AI world in the eyes of Lianjie, Jiangmen, Baidu and country garden venture capital continue to be advanced or return to the essence of business
Simple code implementation of decision tree
Precautions for using latex
mysql的timestamp存在的时区问题怎么解决
Multiline text omission
How does DataGrid export and recover the entire database data, using a single SQL file
Singleton mode (hungry and lazy)
Reproduce 20 character short domain name bypass and XSS related knowledge points
Exness: dove resolution helped gold rebound, and the focus turned to U.S. GDP
军品三大基线(功能基线、分配基线、产品基线)及基线包含的文件
three. JS Part 54 how to pass structure array to shader
Complexity analysis learning
最新二开版漫画小说听书三合一完整源码/整合免签接口/搭建教程/带采集接口
Introduction and advanced level of MySQL (11)
Example analysis of while, repeat and loop loops in MySQL process control
xxxxx
Matlab learning - accumulation of small knowledge points
机器学习【Numpy】
再学EXKMP(EXKMP模板)