Osama Mohammed
Osama Mohammed

Reputation: 2861

Restful Codeigniter

i try to use Restful Codeigniter for make Restful API, i done all installation requirements, and download all Libraries, but when i make this code

<?php
require APPPATH . '/libraries/REST_Controller.php';

class api extends REST_Controller{
  function __construct(){
    parent:: __construct();
  }

  function get_osama(){
    $this -> response('Hello Word');
  }
}
?>

, show me an error in Postman:

</style>
        </head>
        <body>
            <div id="container">
                <h1>An Error Was Encountered</h1>
                <p>Your C:\xampp\htdocs\api\application\config/rest.php file does not appear to contain a valid configuration array.</p>
            </div>
        </body>
    </html>

and in browser also give me this error:

An Error Was Encountered

Your C:\xampp\htdocs\api\application\config/rest.php file does not appear to contain a valid configuration array.

Upvotes: 1

Views: 233

Answers (1)

Omid Aghakhani
Omid Aghakhani

Reputation: 100

Use $this -> response(array('Hello Word')); instead if $this -> response('Hello Word');

Upvotes: 1

Related Questions