【发布时间】:2020-04-05 06:26:54
【问题描述】:
无法从同一 python 文件的另一个烧瓶方法调用烧瓶方法。例如,考虑下面的代码
@app.route('/api/v1/employee/add', method = ['POST'])
def add_employee():
req = request.json
#add the employee to db
@app.route('/api/v1/employee', method = ['GET'])
def get_employee():
data = json.loads(employee) #getting employee details from db
add_employee() # unable to call this method as I am getting the data as null.
如何解决此问题
【问题讨论】:
标签: python python-3.x flask flask-restful