Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 367
Hamid Haqparast Avatar asked Mar 26 '26 14:03

Hamid Haqparast


1 Answers

set rest default format in REST_Controller config file to html

$config['rest_default_format'] = 'html';
like image 83
Saurabh Sharma Avatar answered Mar 28 '26 04:03

Saurabh Sharma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!