Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: 500 when binding to complex parameter with null Content [77]

$
0
0
Server has a 500 from a null reference exception when we call an action with a complex type and the request.content is null.

void MyAction(MyComplexType c)

And then call with: HttpClient.GetAsync()

Request.Content is null, and then we end up with a null reference on the server here:
protected virtual Task<object> ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable<MediaTypeFormatter> formatters, IFormatterLogger formatterLogger)
{
return request.Content.ReadAsAsync(type, formatters, formatterLogger);
}

The expected behavior would be that the action is called and the parameter is just null.


Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>