【发布时间】:2018-01-23 11:49:49
【问题描述】:
我需要使用我的 python 代码实现以下目标: 每当一个新请求到来时,比如 /someurl1,它应该使用下面代码中给出的 URL 调用 category_route。
@app.before_request
def before_request():
url = '/category/c6f8f568-0a25-4ea7-999c-20099effa5f1'
# Now here I need a piece of code which calls the below route's method, with above url.
@category.route('/category/<category_id>', methods=['GET'])
def category_route(category_id):
return {"status": "in category"}
现在应该重定向页面。
【问题讨论】: