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

1
  • 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, 2015 at 23:03

1 Answer 1

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

2
  • 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). Feb 4, 2013 at 9: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 Feb 4, 2013 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.