On 8/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So far, so good, but I'm not sure how to proceed. I should be able to > capture and modify the post data, then urlencode the post values using > urllib, but I cannot figure out how to post the form data AND redirect > the page to the paypal URL in one shot.
You can't redirect and have the browser do a post: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2 " If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. Note: When automatically redirecting a POST request after receiving a 301 status code, some existing HTTP/1.0 user agents will erroneously change it into a GET request. " Because of that, you'll probably end up splitting into two requests, avoiding the problem you're having. > Also, is the view the right place for this logic to occur? Seems like I > should encapsulate it into a function to keep my views.py nice clean. I'd argue it's a model function. Product.get_price(discount_code=None) or something like that. But that doesn't give you a solution by itself. :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---