-1

I have found this post on stackoverflow :
How do I get the different parts of a Flask request's url?
We can get the different parts of the request like this :

With this URL :

  http://www.example.com/myapplication/page.html?x=y

We can get these values :

  path             /page.html
  script_root      /myapplication
  base_url         http://www.example.com/myapplication/page.html
  url              http://www.example.com/myapplication/page.html?x=y
  url_root         http://www.example.com/myapplication/

Is there a way to get the last part (the arguments) in a string ?
--> Get this : ?x=y

Thanks !

PacCol
  • 275
  • 2
  • 15
  • Does this answer your question? [How can I get the named parameters from a URL using Flask?](https://stackoverflow.com/questions/24892035/how-can-i-get-the-named-parameters-from-a-url-using-flask) – LimorAbv Aug 08 '20 at 13:43

1 Answers1

3

Use request.args

@app.route(...)
def some_method():
    args = request.args
    print(args)
LimorAbv
  • 56
  • 5