I have been working on a project where I need to parse various flavors
of XML that are POSTed from various SMS message aggregators into
request_parameters. I tried to take advantage of the built in
ActionController::Base.param_parsers but ran into some serious
Since I can't control the aggregators' HTTP Content-Type headers to
resolve the Mime::Type, I need to rely on the ':format' idiom in Rails
routes. So instead of an HTTP POST to '/sms_messages.xml' I POST to '/
sms_messages.clickatell'. Unfortunately the format parameter isn't
parsed out of the request until after the param_parser is selected:
It appears that the content_type variable can only resolved from the
Content-Type header at this point and not from params[:format] (or any
other parameters for this matter). I need rails to respect the format
of the request over the Content-Type header on a POST or PUT.
I want to fix this but I'm not sure where to start (I get stuck in the
recognize_path code... go figure). Any suggestions or help would be
greatly appreciated to get me heading down the right path.