From 4b2624792b3821154f53ded61f25715f1fdd205d Mon Sep 17 00:00:00 2001 From: abdul_razzak_alkel Date: Wed, 25 Nov 2015 14:00:42 +0800 Subject: [PATCH] support json content in RequestParser --- src/RequestParser.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/RequestParser.php b/src/RequestParser.php index 0655ff8b..f054710b 100644 --- a/src/RequestParser.php +++ b/src/RequestParser.php @@ -140,6 +140,12 @@ public function parseBody($content) return; } + + if (strtolower($headers['Content-Type']) == 'application/json') { + $result = json_decode($content); + $this->request->setBody($result); + return; + } }