In the controller action, I manually submit the form to the remote URL using WebRequest. I successfully get a WebResponse containing the html display page. I would like to βinsertβ this answer as a response (such as an HttpResponseBase) action. An action usually returns an ActionResult, so how can I complete my controller action so that the result of WebResponse is the result?
Note: Url in the browser should also be the response URL.
Update : here is the goal. This is on the PayPal verification page. Instead of having a form with all the hidden fields of the basket and a submit button, in my opinion, I need a simple check button related to one of my actions. In this step, I will prepare WebRequest with the form and submit it to paypal. Performing this action also allows me to store the inactivated order in the database table, so when the order confirmation arrives, I can compare it with the saved order and activate it.
Solution : thanks to those who answered, indicating that it would not be possible to redirect using POST. It seems like I don't have to redirect to paypal using POST. Instead, I can create a URL with all the cart data in the query string and redirect to it. Performing this action using the controller action method allows me to store pending order in the database.
thanks
source share