[mod_python] "Method Not Implemented" on AJAX POST

Graham Dumpleton graham.dumpleton at gmail.com
Mon Jul 21 20:01:15 EDT 2008

You are using a very old version of mod_python, newer versions I
believe do you what you expect.

        if ctype.startswith("application/x-www-form-urlencoded"):
            pairs = parse_qsl(req.read(clen), keep_blank_values)
            for pair in pairs:
                self.add_field(pair[0], pair[1])

Considering that the original author of mod_python is one of the
principles involved in OpenHosting, I'd be surprised if the default
setup is still installing such an old version of mod_python.


2008/7/22  <dylan at dylanwolf.com>:
> Sorry if this is a repeat; I tried to send email earlier without actually
> being subscribed and didn't see it on the archive.
> Don't know if anyone else has run across this, but I've been getting "501
> Method Not Implemented" when making AJAX calls on my mod_python site. This
> has mainly happened when using Firefox 3 or the newest version of
> prototype (JavaScript library).
> I narrowed it down to the Content-Type of the request containing the
> charset. For example, "Content-type: application/x-www-form-urlencoded;
> charset=utf-8" rather than just "Content-type:
> application/x-www-form-urlencoded."
> I'm running mod_python 3.1.4 (on OpenHosting, if that helps explain my
> setup). I was able to fix the problem by changing line 112 in
> mod_python/util.py from:
> if ctype == "application/x-www-form-urlencoded":
> to
> if ctype.startswith("application/x-www-form-urlencoded"):
> Has this been already fixed in a later version of mod_python? If not, I
> figured it might be a good idea to post my fix.
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list