IPN Request.Body is empty so unable to Verify the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Currently trying to implement Paypal integration on .NET Core. I get no issue with the checkout process, but having response problems now that I'm trying to handle the IPN.
I have followed the Paypal IPN code example for .Net Core here
Heres the code for just trying to get the response body:
var formData = new Dictionary<string, string>(); if (Request.ContentType == "application/x-www-form-urlencoded") { Request.Form.ForEach(f => formData.Add(f.Key, f.Value.ToString())); } var requestBody = ""; using (var reader = new StreamReader(Request.Body, Encoding.ASCII)) { requestBody = await reader.ReadToEndAsync(); } var dto = new GatewayRequestDto { Body = requestBody, FormData = formData }; var response = await _gatewayHandler.ProcessResponseAsync(gateway, dto);
Following from that code example I would expect the Request.Body to be populated but it is empty. To make sure I was just getting back a false response I retrieved the Request.Form successfully with the correct data but I believe its in the wrong order so unable to validate it.
Why is the Body empty? Anything that stands out as incorrect?
Thank you in advance!

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Getting 400 Bad Request error when rendering PayPal Button using JS SDK in SDKs
- PayPal Redirection Issue After Successful Payment in Photobooth Integration in Sandbox Environment
- PAYER_ACTION_REQUIRED in REST APIs
- How do I resolve RESOURCE_NOT_FOUND Error? in REST APIs
- Can't pay via PWA on Android with 3rd party cookies blocked. Sign in loop in SDKs