Welcome Guest, Not a member yet? Register   Sign In
How do you get request body data in controller?
#5

[eluser]SpudNik[/eluser]
I was able to get this working by using
Code:
$jsonArray = json_decode(file_get_contents('php://input'),true);
The above will read the request body from the input request and then decodes the JSON to an associative array.

I would still be interested in refactoring this code if CI has a wrapper for reading input stream data as I am above. Fairly new to this framework.
Thanks for the replies.


Messages In This Thread
How do you get request body data in controller? - by El Forum - 02-18-2012, 03:05 PM
How do you get request body data in controller? - by El Forum - 02-18-2012, 04:46 PM
How do you get request body data in controller? - by El Forum - 02-18-2012, 07:16 PM
How do you get request body data in controller? - by El Forum - 02-18-2012, 08:56 PM
How do you get request body data in controller? - by El Forum - 02-19-2012, 01:05 PM
How do you get request body data in controller? - by El Forum - 02-19-2012, 01:16 PM
How do you get request body data in controller? - by El Forum - 02-19-2012, 04:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB