How to save data from http request using codeigniter restful
<p>I am using <strong>restful</strong> to create the web-service for my android app. I have login with Facebook button in my app and I want to store the user data from their Facebook account.</p>

<pre><code>public function sotrefacebookuser_get(){
    $data[] = base64_decode($this-&gt;uri-&gt;segment(3));
    if(!empty($data) &amp;&amp; $data != ""){
        $userid = $this-&gt;Api_model-&gt;savefacebookuser($data);

        if(!empty($userid)){
            $this-&gt;response(array('status'=&gt;'success', 'massage'=&gt; 'Your Record Save successfully'));
        } else {
            $this-&gt;response(array('status'=&gt;'failure', 'massage'=&gt; 'The specified data could not saved try again letter'), REST_Controller::HTTP_NOT_FOUND);
        }
    }
    else {
        $this-&gt;response(array('status'=&gt;'failure', 'massage'=&gt; 'The specified data could not be found'), REST_Controller::HTTP_NOT_FOUND);
    }

}
</code></pre>

<p>The above code is my <strong>API</strong> controller which is working fine but I know, this is not the proper way to do it.</p>

<p>and this is my Model code.</p>

<pre><code>public function savefacebookuser($data){
    $this-&gt;_table = "front_user";
    return $this-&gt;insert($data, FALSE);
}
</code></pre>

<p>how to use the post method in restful to save data?</p>