1

I have this below observation:

I deployed a sample Rails 4.2.2 application with a controller and action to receive a POST request.

Now If I send a POST request to this application with some POST body say a hash like {"1"=>"hello","2"=>"bye"} and if the content type of the request is "application/xml", I don't receive any parameters in my Rails app.

If I change content type of the same request to some thing else , I will get the parameters properly.

Can some one please tell my why this behaviour is there in Rails 4.2.2 with a POST request having content type as "application/xml".

Pavan
  • 33,316
  • 7
  • 50
  • 76
Vipul Kumar
  • 259
  • 1
  • 2
  • 12

1 Answers1

1

Automatic parsing of XML bodies was removed in rails 4.0 and extracted into a gem

Even with that gem your request body isn't valid XML.

Frederick Cheung
  • 83,189
  • 8
  • 152
  • 174
  • Thanks a lot Frederick...Using this Gem helped me to get the params.... But I wonder why did the rails team decided not to support parsing of xml bodies in Rails 4.0....??? – Vipul Kumar Oct 29 '15 at 11:08