Set content type and content lenght headers depending on the output format