/**
  * @inheritDoc
  */
 protected function getParsedBody($body)
 {
     $body = json_decode($body, true);
     if (json_last_error() !== JSON_ERROR_NONE) {
         $message = 'JSON ' . json_last_error_msg();
         throw HttpException::badRequest($message);
     }
     return $body;
 }
Exemplo n.º 2
0
 /**
  * @inheritDoc
  */
 protected function throwException($message)
 {
     throw HttpException::badRequest($message);
 }