Is it possible to have a web service accept json formatted requests without a content-type header?
The POST verb works great when I pass the Content-type: application/json header. If that is left off then a 400 error is thrown. I have gone through many questions on here asking why they are getting a 400 back and the answer is the content-type. So is it possible on the server side to “fill that in” on behalf of the user?
It is not possible with a default .NET webstack to do so without some sort of content-header to tell it how to interpret the request. If you wanted to get into the internals of the ASP.NET stack (you can use a reflector app such as ILSpy) you might could find an intercept point, but you’ll most likely have to do some custom IIS integration to get the module to intercept the request, possibly even before the ASP.NET stack becomes involved.
For most people it’s infinitely easier to get the JSON requesting application to introduce a header.
In addition, I encourage you to start learning how to use Reflector to explore how these stacks work, they really are complex and large and quite extensible, at the cost of engineering (bald guess right now says an inexperienced IIS dev will need approximately 50 hours to engineer this technique, if it can be done neatly).