Yaseen Ahmad
Yaseen Ahmad

Reputation: 1797

restful put method getting wrong result in codeigniter?

I'm creating the android app for my code igniter web site and i want to save data through restful web service but when i send request to my put method it's giving me wrong result.

this is my to view the result.

$data = $this->request->body = file_get_contents('php://input');
    print_r($data);

Result:

------WebKitFormBoundary1FuQsccaxrxHWI5A Content-Disposition: form-data; name="1"

name ------WebKitFormBoundary1FuQsccaxrxHWI5A Content-Disposition: form-data; name="2"

address ------WebKitFormBoundary1FuQsccaxrxHWI5A--

this is my request body:

enter image description here

Upvotes: 0

Views: 96

Answers (1)

Yaseen Ahmad
Yaseen Ahmad

Reputation: 1797

You need to get data from post

Example

$data = $_POST['name'];

Upvotes: 1

Related Questions