Set correct Content-Type header based on output format.