I have a strange case. I have a RoR application that provides a REST API with which I connect from a Java application.
I develop RoR locally and deploy it in Heroku.
No matter how (I tried to use Java APP, Mozilla REST client, etc.), I try to send an HTTP POST request that should be processed by creating an action in the api controller. On the local host - everything works as expected. At Heroku env, the POST request is considered a normal GET.
Here are my routes for this resource:
api_v1_items GET /api/v1/items(.:format) api/v1/items
POST /api/v1/items(.:format) api/v1/items
api_v1_item GET /api/v1/items/:id(.:format) api/v1/items
PATCH /api/v1/items/:id(.:format) api/v1/items
PUT /api/v1/items/:id(.:format) api/v1/items
DELETE /api/v1/items/:id(.:format) api/v1/items
Therefore, I am trying to execute a POST request on /api/v1/items, passing all the necessary parameters.
In localhost, the answer is correct:
Started POST "/api/v1/items?token=l4XOHrhDApPqTp1u4TxBjQ" for 127.0.0.1 at 2014-05-15 22:11:49 +0200
Processing by Api::V1::ItemsController
Parameters: {"height"=>10.0, "item_name"=>"Super item", "width"=>20.0, etc...
However, the same request quit at Heroku, it was considered as GET:
2014-05-15T20:27:58.137541+00:00 app[web.1]: Started GET "/api/v1/items?token=iEdDkDLiDUlWi0mDbr6XYw" for 89.74.57.51 at 2014-05-15 20:27:58 +0000
2014-05-15T20:27:58.223620+00:00 app[web.1]: Processing by Api::V1::ItemsController#index as JSON
? , . .
... , - ?