You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new .NET Web API application by "dotnet new webapi --no-https --name netwebapp".
Open the application in VS Code --> Select "Dapr: Scaffold Dapr Tasks" from Command Palette --> Select ".NET Core Launch (web)" when asked to select a configuration --> Enter an application ID --> Enter an application port.
Add the following within the class definition:
[HttpPost]
public ActionResult Post([FromBody] object body)
{
return new JsonResult(body);
}
Debug with ".NET Core Launch (web) with Dapr".
Right click the running application --> Select "Invoke (POST) Application Method" --> Enter "WeatherForecast" --> Enter an empty payload.
Check the result.
Expect:
The method was invoked and succeeded.
Actual:
Pop up an error.
More Info:
This issue also reproduces for node.js project.
This issue doesn't reproduce when publishing message to application with an empty payload.
The text was updated successfully, but these errors were encountered:
It looks like we're not handling empty payloads properly in the case of post/publish, though it happens to work for publish. I'll create a PR for a fix. Note, however, that you might still get an error response from the server (400 or 415) if the server expects a valid (i.e. non-null) payload (which ASP.NET does, when using the [FromBody] attribute.
OS: All
Build Version: 20200902.2
Repro Steps:
Expect:
The method was invoked and succeeded.
Actual:
![image](https://user-images.githubusercontent.com/62053665/92088382-5d8a2780-edff-11ea-899a-3a6eff84f8b4.png)
Pop up an error.
More Info:
The text was updated successfully, but these errors were encountered: