I have exposed a simple RESTful JSON url via CherryPy (Python web framework). I have a second application (using Pylons) which needs to reach a URL exposed by CherryPy. Both are being served via localhost. Both URLs resolve just fine when using a browser directly.
But, when a DOJO script running from the initial Pylons request invokes the JSON url from CherryPy, it fails. I open LiveHeaders in Firefox and find that DOJO is first sending an HTTP "OPTIONS" request. CherryPy refuses the OPTIONS request with a 405, Method Not Allowed and it all stops.
If I drop this same page into the CherryPy application, all is well.
What is the best way to resolve this on my localhost dev platform? .... and will this occur in Prod?
My guess would be you are serving these two apps locally via 2 different ports, which is making dojo try to execute a cross-domain XHR call.
You need to be able to serve the JSON URL from the same URL (protocol, hostname, & port) to make a successful XHR call.  I do this by using nginx locally, and configuring it to serve the database requests from my Dojo application by forwarding them to CouchDB.
DOJO AJAX Request asking for OPTIONS