python - Flask: How to pass all GET parameters to redirect? -
i this:
return redirect(app.config['fb_app_url'], request.args)
but exception:
attributeerror: 'immutablemultidict' object has no attribute 'split'
is there easier way achieve or have loop through request.args ? thanks
update:
going paolo 's solution, solution worked me.
params = urlparse(request.url).query return redirect(app.config['fb_app_url']+"?"+params)
your code wrong cause second parameter redirect
httpcode (301, 302, ecc).
you can use url_for
create full url, like:
full_url = url_for('.index', **request.args) return redirect(full_url)
Comments
Post a Comment