Yaseen Yaseen - 6 months ago 42
PHP Question

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

Answer

You need to get data from post

Example

$data = $_POST['name'];