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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -