1、python使用flask+flask_restfull框架写的api接口,做为服务

  2、curl 做为客户端发送数据

 

from flask import request

curl发送json的方法:curl -H "Content-Type: application/json" -X POST  --data '{"uid":"1"}'  http://127.0.0.1:8088/v1/intelli_press_end

python的接收json的方法:uid = request.json.get('uid')

 

curl发送form的方法:curl -X POST  --data 'uid=2&stop_type=normal'  http://127.0.0.1:8088/v1/intelli_press_end

flask接收form的方法:uid = request.form['uid']

 

参考:

1、https://my.oschina.net/code33/blog/417424

2、https://gist.github.com/subfuzion/08c5d85437d5d4f00e58

相关文章:

  • 2021-05-02
  • 2021-09-10
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2021-07-15
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案