write header if text/html or text/plain, simply