Re: [Rails] Reading data from request body

2015-08-08 Thread Scott Ribe
On Aug 8, 2015, at 12:32 AM, Panayotis Matsinopoulos wrote: > > Hm. Yes, It works indeed as you say.Thanks for that. To tell you truth, I > tried that from the beginning, but it didn't work for me. But probably was > error on the client side not sending the correct request, rather than on

Re: [Rails] Reading data from request body

2015-08-07 Thread Panayotis Matsinopoulos
Hm. Yes, It works indeed as you say.Thanks for that. To tell you truth, I tried that from the beginning, but it didn't work for me. But probably was error on the client side not sending the correct request, rather than on the server side. Thanks a lot. Best Panayotis On Friday, August 7,

Re: [Rails] Reading data from request body

2015-08-07 Thread tamouse pontiki
On Fri, Aug 7, 2015 at 10:08 AM, Panayotis Matsinopoulos < panayo...@matsinopoulos.gr> wrote: > The question here is whether the way I get the data on controller is the > recommended way to do it, or whether there is other more Rails/better way > to do it. > > The data is also available in params:

[Rails] Reading data from request body

2015-08-07 Thread Panayotis Matsinopoulos
Hi Everyone, In one of my controller actions, I am using data_sent = ActiveSupport::JSON.decode(request.body.read) to get the JSON object sent to this controller via request that has the object/payload inside the body. I am using curl to send/test this, as follows: curl -X POST --header "Cont