I created a WebRequest to POST information. My objective is to emulate in C# a PayPal “buy now” button which is in html.
How do I get the redirect when sending the WebRequest? Simply having Response.Redirect doesn’t work because I have to have the redirect with the information.
The code of the button I’m trying to emulate is:
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
...
</form>
You can not do redirect with
post.What you can do: Make the actually post direct to the paypal, or redirect to a second page that re-create all the post data, and make automatic post with javascript.
An example of how to create a page with parameters that make automatic post.
http://www.codeproject.com/Articles/37539/Redirect-and-POST-in-ASP-NET