Rails 3 has a nice feature where it will parse the body of PUT and POST requests depending on the Content-type given. So for example, if I POST XML to Rails, it will all be decoded for me and put into the params hash.
Well, it’s a nice feature until you try to switch it off, it’s a nightmare to disable! I managed it in the end, here’s what I did…
I created a piece of ‘rack middleware’ that overwrites the Content-Type for given paths:
Added it into the ‘stack’:
Make sure you restart rails, and you should be good to go. If it’s not working, make sure the
rake middleware command is listing the
NoParse class above