I was banging my head against a problem with mod_perl this afternoon. I am writing a very simple SOAP service (in fact its REST really but .Net/Java programmers seem to have a problem writing software that isn't generated mostly by WSDL and clicking on buttons, so SOAP it is) After a while I managed to get a hint from mod_perl as to why it was eating the postdata that my SOAP::Lite client had sent : [libapreq] unknown content-type: 'text/xml; charset=utf-8'. It didn't like 'text/xml' either. I know the mod_perl and apache maintainers would love us all to move to Apache 2 and mod_perl 1.99999999 or whatever it is, but not bothering to update mod_perl to handle basic web service content types is really lame. Anyway, there is a solution. 'use CGI;', get your parameters with '$cgi->Vars' and bobs your uncle. If Apache is so lame at handling mime-types that CGI.pm can handle then why not patch Apache::* based on the code in CGI. After all, one the great things about apache/mod_perl is that you have the power in perl to pull stunts in apache modules without having to recompile your apache or libraries (even without having to restart apache if you use the appropriate module and setting).
This is a libapreq problem, not a mod_perl problem per-se. If you don't convert $r into an Apache::Request object, you shouldn't see the warning.
On a side note, calling the class "Apache::Request" is completely daft because it's completely different from the object returned by Apache->request, which is just a plain "Apache" object. Gah.
-Dom
Re:a more effective way to request a feature
TeeJay on 2005-02-04T15:36:23
Yes, that would be better.I was mostly making a note for myself or others who are likely to trip over the problem.
I'll sub to the list and ask about why its happening (i.e. why some content-types aren't handled).
Re:[libapreq] unknown content-type: `text/javascri
mishoo on 2007-01-27T10:59:35
oh, well.
1) s/found/find/
2) I see your CGI-based solution but not sure how to apply it in my case. I need to read POST data, thought that $r->read is the fastest and most straightforward way.:-/