phprestapicodeigniter

text/html format in codeigniter rest_controller response


I need a response in text/html format in one of the methods of the my web service.

I use the following code, but it returns the string inside double quotation marks:

$this->response("test", REST_Controller::HTTP_OK);

Response

How can I have the response as this (without quotation marks):

test

Solution

  • set rest default format in REST_Controller config file to html

    $config['rest_default_format'] = 'html';