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

[eluser]pmonty[/eluser]
I am using this in my code:
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):
Code:
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?

Paul
#2

[eluser]batteries[/eluser]
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'); ?
#3

[eluser]pmonty[/eluser]
Batteries,

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.

Paul




Theme © iAndrew 2016 - Forum software by © MyBB