Use rest::http_content_type() instead of the header() method to set response content

This commit is contained in:
Tim Almdal
2008-11-20 17:51:12 +00:00
parent b78cee6395
commit 8c06908f7f
2 changed files with 3 additions and 3 deletions

View File

@@ -118,12 +118,12 @@ class Comment_Core {
switch (rest::output_format()) {
case "xml":
header("Content-Type: application/xml");
rest::http_content_type(rest::XML);
return xml::to_xml($comments, array("comments", "comment"));
break;
case "json":
header("Content-Type: application/json");
rest::http_content_type(rest::JSON);
foreach ($comments as $comment) {
$data[] = $comment->as_array();
}