src/Response/Response.php
public function setJsonBody($data)
    {
        $this->addHeader("Content-Type: application/json; charset=utf8");
        $this->setBody(json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
        return $this;
    }
public function setJsonBody($data)
    {
        $this->addHeader("Content-Type: application/json; charset=utf8");
        $this->setBody(json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
        return $this;
    }
public function setJsonBody ( $ data ) { $ this -> addHeader ( "Content-Type: application/json; charset=utf8" ) ; $ this -> setBody ( json_encode ( $ data , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ) ; return $ this ; }
Set body with JSON data.

@param mixed $data to be encoded as json.

@return self
Set body with JSON data .