So far I\'ve found two ways for request.format.json? to be true in Rails (i.e. where the incoming request is treated as JSON). One is if you request a resource and
request.format.json?
An alternative to this is:
api_mime_types = %W( application/vnd.api+json text/x-json application/json ) Mime::Type.unregister :json Mime::Type.register 'application/json', :json, api_mime_types
In initializers/mime_types.rb.
initializers/mime_types.rb