Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Add example how to access raw body request and e.g. parse JSON from it #60

mfn opened this Issue · 1 comment

2 participants



in my environment I needed to process a PUT request which has a JSON payload in its body (but it's not POST request, so I can't access that payload easily).

I found the solution at in which the guy also describes that it wasn't easy to find out; especially it's not obvious that there's a request object available (it may be by skimming through the tutorial, but what I mean is that it's not explicitly told albeit still very useful).

Anyway, it boils down to that with the following code

put '/test' do
  data = JSON.parse( )

Only is able to easily access it (once you find out). It would be nice to document this inside the tutorial!



Added documentation.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.