'Request' object has no attribute 'get' Python error

flask, python, query-string

Solution

You want to use `request.args` for your GET parameters in Flask. Here is a quote with an example from the Accessing Request Data section of the Quickstart document.

To access parameters submitted in the URL (?key=value) you can use the args attribute:

searchword = request.args.get('key', '')    

Problem

I am trying to get a url parameter in Python. I am using this code: ``` from flask import request, url_for, redirect # ... controller = request.get('controller') ``` but I am getting this error: ``` 'Request' object has no attribute 'get' ``` Any ideas? Thanks

Original source