JSON.parse(request.env["rack.input"].read)
- Patrick
> --
> You received this message because you are subscribed to the Google Groups "sinatrarb" group.
> To post to this group, send email to sina...@googlegroups.com.
> To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.
>
>
The return value of the block is what Sinatra will send back as the
response body.
Try:
post "/changes" do
# ...
local_changes_array = bodyJSON["LocalChangesArray"]
local_changes_array.to_json
end
> Try this:
>
> JSON.parse(request.env["rack.input"].read)
>
> - Patrick
You should do a request.env["rack.input"].rewind first.
Konstantin