title: How to call method name in form action while working with REST API using codeigniter?
body: <p>Hello everyone I am working on REST API in Codeigniter but i am surprise  in normal codeigniter when we give method name after controller for example(localhost/project_name/controller/user_get) it will get all users from table but while working with REST API in Codeigniter I am getting unknown method error please tell me how to define method name while rest api in form action</p>
  
  <p>below i have written  my code</p>
  
  <p>in view page when i want to click button in form it should call method and retrieve all users</p>
  
  <pre><code>&lt;form method="post" action="&lt;?=base_url('index.php/Api/user_get')?&gt;"&gt;
  
      &lt;button&gt;Click Here&lt;/button&gt;
  
  
  &lt;/form&gt;
  </code></pre>
  
  <p>controller code</p>
  
  <pre><code>&lt;?php
  
  defined('BASEPATH') OR exit('No direct script access allowed');
  
  require(APPPATH . '/libraries/REST_Controller.php');
  
  class Api extends REST_Controller {
  
      public function __construct() {
          parent::__construct();
          $this-&gt;load-&gt;model('user_model');
      }
  
  
    public function user_get() {   //this method will get all users from table
              $r = $this-&gt;user_model-&gt;read();
              $this-&gt;response($r);
          }
  
  
        public function user_put() { //this method will insert users details 
             $id = $this-&gt;uri-&gt;segment(3);
              $data = array('name' =&gt; $this-&gt;input-&gt;get('user_name'),
                  'pass' =&gt; $this-&gt;input-&gt;get('user_password'),
                  'type' =&gt; $this-&gt;input-&gt;get('user_type')
              );
              $r = $this-&gt;user_model-&gt;update($id, $data);
              $this-&gt;response($r);
          }
  
  }
  </code></pre>
  
  <p>Below code written in model</p>
  
  <p>public function read() {</p>
  
  <pre><code>   $query = $this-&gt;db-&gt;query("select * from `tbl_user`");
  
     return $query-&gt;result_array();
  </code></pre>
  
  <p>}</p>
  
  <p>Getting error like this</p>
  
  <p><img src="https://i.stack.imgur.com/ykktL.png"/></p>