ASP.NET - How do I 'follow' a redirect from a response to an http post generated by a server side process?
I have a scenario that I'm not sure how to handle in ASP.NET.
I am setting up an automated payment system that is a conversion from the previous manual, user driven payment system.
The system previously worked like so:
1.The user fills in a payment form, and submits the form.
2.This causes an http post to a remote page.
3.The remote page processes the post data, and the payment.
4.The remote page forwards the web browser on to a call back page on the original website, along with query string data开发者_JAVA百科 which allows the recording of the response.
The automated system checks for due payments, and then works like so:
1.Create a server side http post and submit.
2.....
And here is where I've got to. I've got an HttpWebRequest, and I then get the HttpWebResponse which I can read.
The problem is that the request doesn't seem to follow the response. I don't see evidence of the code in the Callback page firing.
Is as though the redirect in the remote page isn't honoured unless a browser is used to do the posting.
Hope this makes sense?
Any pointers on how I should be handling this type of scenario?
Did you set the AllowAutoRedirect property to true
?
精彩评论