0

I have headers set as Accept application/json and content-type application/json for my POST webservice. Follwing are the requested parameters:

 { 
  "OccupantID": 162921,
  "BuildingID": 13294,
  "QuizID": 397,
  "Score": 3,
  "Result": "fail"
 }

routes.rb

  map.connect '', :controller => 'quiz_v2', :action => 'record_quiz_result', :conditions => { :method => :post }

When I try to see params in my controller's action

  def record_quiz_result
   p params
  end
 It returned just controller_name and action_name

I dont know what is happening here, May be I missed something. Any Help

Chitrank Samaiya
  • 841
  • 10
  • 20

1 Answers1

0
Goto Headers => Custom Header 

1.Content-Type as name and application/x-www-form-urlencoded as value and save it.

2.Now enter ur params in body which should be available and accessible through the params hash in rails

Hope it helps

Pramod Solanky
  • 1,690
  • 15
  • 17