backbone.jsでsaveするときの注意点

Backbone.js のPOSTリクエスト
Content-Type: application/json

PHPのPOSTリクエスト
Content-Type: application/x-www-form-urlencoded

 

php側でリクエストボディをみて値を取得する必要がある。

 

$requestBody = json_decode(file_get_contents(‘php://input’), true);