I'm having some problems with forcing the JSON formatter being the default fallback method. I'm supporting both JSON and XML media types, but I want the JSON formatter to be the default fallback.
I've managed to make it work when the Accept header is set to */* or empty (but header still present), but when the header is missing the XML formatter kicks in!
I've tried all kinds of tricks mentioned in discussion threads on this forum, including inserting the formatter at 0 and this snippet:
JsonMediaTypeFormatter jsonDefault = config.Formatters.JsonFormatter;
The only fix I can think of right now is to add a handler that adds a Accept header when none is present, but it would be nice to be able to control this somehow :) Is the WebApi hardcoded to fallback to the XML formatter?