{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/19514","labels_url":"https://api.github.com/repos/rails/rails/issues/19514/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/19514/comments","events_url":"https://api.github.com/repos/rails/rails/issues/19514/events","html_url":"https://github.com/rails/rails/issues/19514","id":64302141,"number":19514,"title":"Default URI format is forced over Accept header","user":{"login":"gmile","id":207112,"avatar_url":"https://avatars.githubusercontent.com/u/207112?v=3","gravatar_id":"","url":"https://api.github.com/users/gmile","html_url":"https://github.com/gmile","followers_url":"https://api.github.com/users/gmile/followers","following_url":"https://api.github.com/users/gmile/following{/other_user}","gists_url":"https://api.github.com/users/gmile/gists{/gist_id}","starred_url":"https://api.github.com/users/gmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmile/subscriptions","organizations_url":"https://api.github.com/users/gmile/orgs","repos_url":"https://api.github.com/users/gmile/repos","events_url":"https://api.github.com/users/gmile/events{/privacy}","received_events_url":"https://api.github.com/users/gmile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-25T15:43:30Z","updated_at":"2015-03-25T16:09:50Z","closed_at":null,"body":"Rails forces format, [specified in default](http://guides.rubyonrails.org/routing.html#defining-defaults) over the one, provided in `Accept` header.\r\n\r\nThis is somewhat counterintuitive. Semantic meaning of `default` is to yield a _fallback option_ if no other option was provided. However, right now `default` is forced.\r\n\r\nUpon digging up the Rails, codebase, it became apparent that Rails [takes the `format` param](https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/http/mime_negotiation.rb#L64-L67) as the one having priority over `Accept` header. \r\n\r\nI personally don't think it is correct, but I can't quickly establish anything RFC-like to prove which one should take precedence: the inferred (in my case: default) response content type, or the one provided by the `Accept` header.\r\n\r\nI'm going to provide an example app (via a [template](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb)) to back my point."},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/86098153","html_url":"https://github.com/rails/rails/issues/19514#issuecomment-86098153","issue_url":"https://api.github.com/repos/rails/rails/issues/19514","id":86098153,"user":{"login":"gmile","id":207112,"avatar_url":"https://avatars.githubusercontent.com/u/207112?v=3","gravatar_id":"","url":"https://api.github.com/users/gmile","html_url":"https://github.com/gmile","followers_url":"https://api.github.com/users/gmile/followers","following_url":"https://api.github.com/users/gmile/following{/other_user}","gists_url":"https://api.github.com/users/gmile/gists{/gist_id}","starred_url":"https://api.github.com/users/gmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmile/subscriptions","organizations_url":"https://api.github.com/users/gmile/orgs","repos_url":"https://api.github.com/users/gmile/repos","events_url":"https://api.github.com/users/gmile/events{/privacy}","received_events_url":"https://api.github.com/users/gmile/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T16:09:50Z","updated_at":"2015-03-25T16:09:50Z","body":"@kostyl hmm, no, I don't think so.\r\n\r\n1. you must make sure you always pass in `.json` type with your URLs (do you?),\r\n2. I think browser (actually, some ember middleware) should set `Accept: application/json` automatically, but I'm not certain,\r\n3. tests pass, so I think we're good at least in some way?"}}