> 文档中心 > python bottleweb框架接口

python bottleweb框架接口

import bottle
#接口名称和请求方式@bottle.post('/img',method='Post')def index():     dataPath = bottle.request.query.dataPath#post获取参数    outPath = bottle.request.query.outPath  # post获取参数      #业务处理模块    try:  return '200'    except Exception as e: print("调用失败:%s" % e) return  '500'#启动类型 ip地址和端口run(host='127.0.0.1',port=8000)