Bluz\Response\Response::switchType PHP Method

switchType() public method

Set Response Type, one of JSON, HTML or CLI
public switchType ( $type )
$type
    public function switchType($type)
    {
        // switch statement by content type
        switch ($type) {
            case 'JSON':
                $this->setHeader('Content-Type', 'application/json');
                break;
            case 'CLI':
            case 'HTML':
            default:
                break;
        }
        $this->type = $type;
    }