maiah/synth — pull request #11 by sqs (2012-10-13 23:03:14+00:00)
Title: Add reqJsonContent middleware for parsing JSON POST data

Not sure how you would prefer this to be implemented, but this allows you to handle requests such as:

`curl -XPOST -H 'Content-Type: application/json' -d '{"name": "hello"}' http://localhost:7000/hello`

with:

````
use(reqJsonContent);
route('POST', '/hello', (req, res) {
res.write('got ${req.dataObj}');
});
````

I thought about having `reqJsonContent` populate `Request`#`dataMap`, but JSON is not always a map (could be array, etc., and Dart's non-conforming JSON parser seems to also allow nums/strings/null/etc. as top-level objects).