当前位置:网站首页>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
边栏推荐
- 复现20字符短域名绕过以及xss相关知识点
- Shortcut key for adjusting terminal size in ROS
- makefile详解
- for_ Example of each usage
- [technology 1]
- web-uploader不能多文件上传
- Bingbing learning notes: operator overloading -- implementation of date class
- NXP i.mx8mp-deepviewrt
- HDU多校第二场 1011 DOS Card
- Producer consumer model of concurrent model
猜你喜欢

KNN method predicts pregnancy, KNN principle simple code

for_ Example of each usage

Rongyun real-time community solution

容斥原理

数字孪生实际应用案例-智慧能源篇

Reproduce 20 character short domain name bypass and XSS related knowledge points

STC MCU drive 1.8 'TFT SPI screen demonstration example (including data package)

for_each用法示例

How to deploy sentinel cluster of redis

CUDA GDB prompt: /tmp/tmpxft**** cudafe1.stub. c: No such file or directory.
随机推荐
How does DataGrid export and recover the entire database data, using a single SQL file
Principle knowledge is useful
July 28, 2022 Gu Yujia's study notes
Sanzi chess (player + computer)
如何判定是stun协议
Calculation of array serial number of force deduction questions (daily question 7/28)
STC MCU drive 1.8 'TFT SPI screen demonstration example (including data package)
Score addition and subtraction of force deduction and brushing questions (one question per day 7/27)
Typescript learning (I)
MySQL流程控制之while、repeat、loop循环实例分析
During the year, the first "three consecutive falls" of No. 95 gasoline returned to the "8 Yuan era"“
How to realize multi line annotation in MATLAB
How dare you write a resume that is proficient in concurrent programming? Why do you use a two-way linked list in AQS?
1.6 example: cifar-10 classification
Multi level wavelet CNN for image restoration
复现20字符短域名绕过以及xss相关知识点
NXP i.mx8mp-deepviewrt
Let's talk about the summary of single merchant function modules
Microcomputer principle operation
MOS管 —— 快速复苏应用笔记(贰)[参数与应用]