我正在使用的代码如下,在 coffeescipt 中:
request_with_token =
get:
method: "JSONP",
params:
token: app["token"]
save:
method: "POST",
params:
token: app["token"]
$rootScope.API = "http://0.0.0.0:5200/1.0"
$scope.ajaxAccountUpdate = $resource($rootScope.API + "/account/update.json",
{ callback: "JSON_CALLBACK" }, request_with_token )
user = $scope.user
$scope.ajaxAccountUpdate.save user, (resource) ->
$scope.show_message(resource)
但是在我的日志中,我有一个 OPTIONS 而不是 POST
[07/Feb/2013 16:50:48] "OPTIONS /1.0/account/update?callback=JSON_CALLBACK&token=mytoken HTTP/1.1" 200 -
谢谢