Question marks in Flask Urls for routing [duplicate] Question marks in Flask Urls for routing [duplicate] flask flask

Question marks in Flask Urls for routing [duplicate]


The part after the ? is the query string, which you can get using request.args. So, your route should be:

@app.route("/menu-card", methods=['GET'])

and then you can get the id by using:

google_place_id = request.args.get('id', None)

where None is the default value, if id is not included in the url. You'll have to check if that it's not equal to None to make sure it has been passed.

Search the quickstart page for request.args to see another example.