I am writing an API and it receives a JSON payload as the request body.
To get at it currently, I am doing something like this:
post \'/doSomething\'
before do request.body.rewind @request_payload = JSON.parse(request.body.read, symbolize_names: true) end
So you can also symbolize_names while parsing JSON request body, this will give you access to your nested params like this @request_payload[:user]
@request_payload[:user]