1

I am trying to pass a dictionary to HttpRedirect or HttpFound method so that I can use this dictionary at the redirected url.

I am using route module for url connect and using cherrypy and webob for Https.

I want to do like this return HttpRedirect(location=location, mydict)

where HttpRedirect extends HttpFound of webob

Deepak Verma
  • 653
  • 1
  • 10
  • 24
  • Upon redirecting the browser goes to the new URL, to pass information between requests you will need to pass the information in the URL or in a cookie. – X-Istence Dec 29 '15 at 23:03

1 Answers1

0

you have (at least) two ways

  1. HttpRedirect(mydict, location=location) or HttpRedirect(httpdict=mydict, location=location): explicitly pass the dictionary as positional argument or keyword argument and then access the dictionary
  2. use a more abstract and flexible approach implementing something like this HttpRedirect(location=location, **kargs) and then passing mydict doing HttpRedirect(location=location, **mydic).

for a short tutorial on positional and keyword arguments read here

Francesco Montesano
  • 8,485
  • 2
  • 40
  • 64
  • Here I am getting another problem. If i pass dict in HttpRedirect then how can I access that dict in my action (route is used for url mapping and action is the method called by route to respond the HttpRedirection). – Deepak Verma Feb 04 '13 at 09:58
  • (After reading the tutorial,) Try to implement what you want to do. If it does not work, edit your post adding what you have tried and someone will help you continue. Without more info, it's hard to help – Francesco Montesano Feb 04 '13 at 10:03