How to access Scalatra HTTP POST content (data) in post method

If you have a Scalatra POST method like this:

post("/foo") {
  // do stuff here
}

you can access the data that's sent to your POST function by using the implicit request object, like this:

val content = request.body

Then you can operate on that content as desired.