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

[eluser]Aken[/eluser]
Is there a reason you're setting the content type to JSON? You shouldn't need to specify the content type unless wherever you are sending the data explicitly needs a JSON request. Just because your data is in JSON doesn't mean it's going to stay that way once it goes through the ajax call (it doesn't, btw). You should be able to remove that line, then use $this->input->post() like normal.

Also, the "dataType" parameter is specifying what format the RESPONSE will be in, so if you set that, make sure your response is in JSON and not something else, or your returned data might not work properly.


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