Cant read the request body using StreamReader
negrifelipe opened this issue · comments
- NuGet Package Version: 4.0.1
- .NET SDK Version: 6.0
Steps to Reproduce:
- Create a post endpoint without request and without result
- Try to read the request body using StreamReader
Here is my full code: https://github.com/negrifelipe/Payments/blob/f74c37141bdf402774b42bc183bcbad538d8c243/src/Payments.Providers.PayPal/Endpoints/NotifyEndpointAsync.cs#L38 using a normal controller solved the issue
What error did you get?
I got an empty string
Maybe its something related to controllers because the endpoint is still a controller the only thing that changes is that the endpoint inherits a class that its a controller
Can you post your working code? I have no idea why a vanilla controller would work and the inherited controller used by this package wouldn't. Thanks!
Working code: https://github.com/negrifelipe/Payments/blob/2e7d866160ade93cc17c13aafa71942d8c97b94c/src/Payments.Providers.PayPal/Controllers/PaypalController.cs#L35
Not working code: https://github.com/negrifelipe/Payments/blob/f74c37141bdf402774b42bc183bcbad538d8c243/src/Payments.Providers.PayPal/Endpoints/NotifyEndpointAsync.cs#L38