I’m making a cross-domain POST request and have set up headers in Rails 3.2 to accept the request appropriately – both the OPTIONS and POST request are received by the controller correctly.
The problem I’m finding is that Rails controller is receiving the JSON data as HTML. Why is this? How can I force the controller to treat it as JSON? (doing this from the client-side would be preferable)
If this is unclear let me know which messages/code I ought to post for better assistance. Thanks
You could try adding the
JSONextension to the URL that you’re making a request to, i.e.https://your_domain.com/your_url.json, which should force theJSONformat.