public function setDataContent($content)
    {
        if (is_array($content)) {
            $this->headers->set('Content-Type', 'application/json');
            $content = json_encode($content);
        }

        $this->setContent($content);
    }
public function setDataContent($content)
    {
        if (is_array($content)) {
            $this->headers->set('Content-Type', 'application/json');
            $content = json_encode($content);
        }

        $this->setContent($content);
    }
public function setDataContent ( $ content ) { if ( is_array ( $ content ) ) { $ this -> headers -> set ( 'Content-Type' , 'application/json' ) ; $ content = json_encode ( $ content ) ; } $ this -> setContent ( $ content ) ; }
if content is an array, then convert to json
@param mixed $content
if content is an array then convert to json