public function toJson(array $default = null)
    {
        if (!$this->returnTransfertToPlain()) {
            if (is_array($default)) {
                return json_encode($default);
            }

            return false;
        }

        $data = $this->raw();

        return json_encode($data);
    }
public function toJson(array $default = null)
    {
        if (!$this->returnTransfertToPlain()) {
            if (is_array($default)) {
                return json_encode($default);
            }

            return false;
        }

        $data = $this->raw();

        return json_encode($data);
    }
public function toJson ( array $ default = null ) { if ( ! $ this -> returnTransfertToPlain ( ) ) { if ( is_array ( $ default ) ) { return json_encode ( $ default ) ; } return false ; } $ data = $ this -> raw ( ) ; return json_encode ( $ data ) ; }
Get response content as json

@param  array $default
@return string
@throws
Get response content as json