此代码,
$http.jsonp('http://localhost:3000/students?callback=JSON_CALLBACK',{
data:student,
method:'POST'
})
发送GET请求而不是POST请求。 Rails日志:
Started GET "/students?callback=angular.callbacks._1" for ::1 at 2015-03-28
20:07:30 -0500
Processing by StudentsController#index as */*
Parameters: {"callback"=>"angular.callbacks._1"}
Student Load (0.5ms) SELECT `students`.* FROM `students`
Rendered students/index.jpbuilder (2.4ms)
Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.5ms)
我该如何解决?