A DelegatingHandler to return 415 status code.
Have you ever got a "No MediaTypeFormatter is available to read an object of type 'foo' from content with media type 'bar'" on your Web API application?
And that error is usually because some dumbass folk forgot to put the proper Content-Type
on the request.
It's their fault, not mine.
It's supposed to be an error of the 400 familyย (415 to be more precise) and not a 500.
using UnsupportedMediaTypeLibrary;
GlobalConfiguration.Configuration.MessageHandlers.Add(new UnsupportedMediaTypeHandler());