I create a form and when I click the submit button, I assign the 3 value into a javascript dict and send it over to a python script to process however My web browser tell me a error!
from Json error: {u'food': 90, u'cargo': 70, u'fuel': 50} SyntaxError
controller.js
function customiseCtrl($xhr){
var self = this;
checkPoint();
this.process = function(){
if (checkPoint()){
var newPlayer = {"fuel":value, "food":value2, "cargo":value3 };
$xhr('POST', '/process', newPlayer, function (code, response) {
self.x = response;
});
}
};
}
/process --> python script (I am trying to read the information of "info" and write it into the Google app engine.
def post(self):
user = users.get_current_user()
player = Player();
info = json.loads(self.request.body)
player.fuel = info.fuel
self.response.out.write(info)