ardalis / ApiEndpoints

A project for supporting API Endpoints in ASP.NET Core web applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. Create a post endpoint without request and without result
  2. 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!