Welcome Guest, Not a member yet? Register   Sign In
Setting Content type in header

I am using this in my code:
$this->output->set_header("Content-type: text/xml");
//do some stuff and then
echo $xmlstream;

But gettng this in my headers (using an http analyzer to capture the http stream):
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Mon, 09 Jul 2007 19:56:53 GMT
Connection: close
X-Powered-By: PHP/5.2.3
Content-type: text/html

Am I using the wrong syntax or something in my set_header command that anyone can see?


make sure nothing is output before header. Just some ideas.. but have you tried capitalizing the 't' in 'type'? (i'm not sure if that even matters) have you tried header('Content-Type: text/xml'); ?


Tried both capitalizing the T in Type and enclosing in single quotes...no diff. The headers still come through in the response as type text/html. The set_header is the first thing in my controller.


Theme © iAndrew 2016 - Forum software by © MyBB