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.
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.