'Server to Server HTTP Post Call with XML Data is not working
I am working on integration of ASP.NET MVC application with a third party payment gateway.Here is the issue: We finalize the order cart on our website and once confirmed, the app redirects to the payment provider website for payment. I was able to submit the payment successfully on provider website . Once The payment was successful, the provider is calling our endpoint(mvc) using server to server post call with xml payload as part of the body. My end point is being called, but xml is not received. ContentType is coming as Text/Plain HttpContext.Request.InputStream is coming as null.
[AllowCrossSite]
[AllowAnonymous]
[HttpPost]
[ValidateInput(false)]
public async Task<ActionResult> ProcessPaidResponse(){
using (StreamReader stream = new StreamReader(HttpContext.Request.InputStream))
{
HttpContext.Request.InputStream.Position = 0;
var strPaidXMLResponse = await stream.ReadToEndAsync(); } }
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
