我的 POST 网络服务的标头设置为 Accept application/json 和 content-type application/json。以下是请求的参数:
{
"OccupantID": 162921,
"BuildingID": 13294,
"QuizID": 397,
"Score": 3,
"Result": "fail"
}
路线.rb
map.connect '', :controller => 'quiz_v2', :action => 'record_quiz_result', :conditions => { :method => :post }
当我尝试查看控制器操作中的参数时
def record_quiz_result
p params
end
It returned just controller_name and action_name
我不知道这里发生了什么,可能是我错过了什么。任何帮助