Whenever I make an API request from my angular front end to my Rails back end, the API calls are interpreted as content-type: :html. However I want them to be interpreted as content-type: :json
Inspecting the incoming request the content_type is correctly set to be "application/json"
however the request.format evaluates to being :html
17:23:27 web.1 | (rdb:1) request.content_type
17:23:27 web.1 | "application/json"
17:23:31 web.1 | (rdb:1) request.format
17:23:31 web.1 | #<Mime::Type:0x007fb523405d00 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html">
What am I doing wrong, should I be forcing the headers on the client-side or do I have the wrong end of one of these sticks?
Edit
I guess that Rails is using the file ending to determine the required format - is there any way to make it respect the headers instead?