MVP where to set Content-type header?

I’m having some problems with deciding where to set the content-type header in a vanilla mvc framework. Should i add it inside the controllers method:

class ApiController extends Controller{      public static function v1(){         header('Content-Type: application/json');         //some logic to output some json     }      }  

My mvc works more like an mvp:

Model <--> Controller <--> View