I send via Advanced Rest Client to Phalcon

$app->put('/feedback/{id:[0-9]+}', function ($id) use ($app) { $test = $app->request->getJsonRawBody(); file_put_contents('test2.txt',json_encode($test),FILE_APPEND | LOCK_EX); 

Everything is normally written, read

enter image description here I try to send from Angularjs

  this.resource = $resource(url, {}, { query: {method: 'GET', params: {quest_id: '@quest_id'}, isArray: true}, delete: {method: 'DELETE', params: {}, isObject: true}, save: {method: 'POST'}, update: { method: 'PUT', headers: { 'Content-Type': 'application/json' }, params: {quest_id: '@quest_id',feedback:'korolariya'} } }); 

$ scope.feedback.resource.update ({"feedback": "korolariya", "user_id": "24", "quest_id": "5"});

The request goes away but there is nothing in json, and it doesn't go to POST because PUT

    1 answer 1

    In general, I poked at random:

     update: { method: 'PUT', transformRequest: function(data, headers){ console.log(headers); headers = angular.extend({}, headers, {'Content-Type': 'application/json'}); console.log(headers); console.log(data); console.log(angular.toJson(data)); return angular.toJson(data); // this will go in the body request }, params: {quest_id: '@quest_id'} } 

    leave if suddenly someone has a similar problem, well, or I repeat