Ali
Ali

Reputation: 243

How do I get the url parameter in a Flask view

I am trying to get the url parameters from a flask view:

www.domain.com/?f=x**2

How do I get x**2 from the url in a Flask view?

Upvotes: 21

Views: 18296

Answers (1)

Jason
Jason

Reputation: 52523

You can retrieve query string variables using

request.args.get('myParam')

or

request.args['myParam']

Where myParam is the variable in the query string you're trying to receive.

Upvotes: 39

Related Questions