Romeo M. Romeo M. - 1 year ago 170
Python Question

Getting the array as GET query parameters in Python

I know in php I could just use

to retrieve GET data that is sent in the form of an array but is that something possible in Python as I just receive a string and it's not recognized as an array/list.

I use flask/werkzeug if that matters.

Answer Source

The deep parsing of argument names is unique for PHP AFAIK.

If you need just a simple list, just pass several parameters with the same name and use request.args.getlist(<paramname>) (documentation).

Otherwise you have to parse the query string yourself.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download