我想在URL中传递多个参数,但只有一个参数正在接受。我使用了URL curl -i http://localhost:5000/details_page/api/v1.0/recommendation?content_id=SINGTEL_movie_22937&category=details_page,但只有content_id
正在通过。在URL中传递多个参数与烧瓶
@app.route('/details_page/api/v1.0/recommendation', methods=['GET'])
def recommendation():
category = request.args.get('category')
content_id = request.args.get('content_id')
print(content_id)
print(category)
return(content_id,category)
if (category !='details_page'):
abort(404)
contents = cl.details_page(content_id)#goes to my logic
return(jsonify({'content_id':contents}), 201)
考虑接受你的自己的答案。 –