I'm wondering how to go about obtaining the value of a POST/GET request variable using Python with Flask.
With Ruby, I'd do something like this:
variable_name = params["FormFieldValue"]
How would I do this with Flask?
If you want to retrieve POST data:
first_name = request.form.get("firstname")
If you want to retrieve GET (query string) data:
first_name = request.args.get("firstname")
Or if you don't care/know whether the value is in the query string or in the post data:
first_name = request.values.get("firstname")
request.values is a CombinedMultiDict that combines Dicts from request.form and request.args.