Exemplo n.º 1
0
 /**
  * @param \CurlResponse $response
  * @return \stdClass
  * @throws JsonException
  */
 protected function getResponseBody(\CurlResponse $response)
 {
     try {
         return Json::decode($response->body);
     } catch (HampelJsonException $e) {
         throw new JsonException($e->getMessage(), $e->getCode());
     }
 }
Exemplo n.º 2
0
 /**
  * Decode json data from request
  * @return mixed|null
  */
 protected function jsonRequest()
 {
     $input = null;
     try {
         $input = Json::decode(trim($this->app->request()->getBody()), true);
     } catch (JsonException $ex) {
         $input = null;
     }
     return $input;
 }