
Qui Le
9,593 PointsWhat is request.args.get() method? and Why is the first argument to this method is a string 'name'?
Want to understand more about request function from flask
1 Answer

Chris Freeman
Treehouse Moderator 62,604 PointsThe flask Request object contains the attributes of the URL request. The args
attribute is a dictionary containing arguments from the URL. The get()
method is a built-in dictionary method that will “get” an item from a dictionary or return a default value (None
if key not found). In this case, it avoids a KeyError
if “name” argument not found.
Post back if you need more help. Good luck!!!
Qui Le
9,593 PointsQui Le
9,593 PointsThank you, Chris!!