Welcome Guest, Not a member yet? Register   Sign In
Problem w/ retrieving $_POST content with REST_Controller and REST api
#1

[eluser]Unknown[/eluser]
I am trying to use Phil Sturgeon's REST_Controller to setup a REST api to receive request from Backbone.js, and then update them in a MySQL DB through php.
Backbone.js by default send a RESTful json request.

The problem I have is I'm not able to use $this->post('name') to retrieve the POST content. When it enters it into the DB, it created a new entry, but the content is 0.

Here are some relevant info from the browser console

Request MethodTongueOST
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:15
Content-Type:application/json
Host:www.williamsham.com
X-Requested-With:XMLHttpRequest

Request Payload
{"title":"my Content!!"}




Theme © iAndrew 2016 - Forum software by © MyBB