Flask-RESTPlus - How to get query arguments?

nikitz picture nikitz · Jan 4, 2017 · Viewed 12.1k times · Source

I'm curious how I can take query arguments coming from the GET method in Flask-RESTPlus. I didn't managed to find an example in the documentation.

I have previously used pure flask and the way I was doing it was by calling 'request.args.get()' from the flask library. Any ideas how to achieve this in RESTPlus?

Answer

jbasko picture jbasko · Jan 4, 2017

It's a Flask plugin, it shouldn't be breaking the Flask interface. So you should be able to get them from flask.request as always:

import flask

...

print(flask.request.args.get("name"))