Reputation: 11
I'm trying to call Restlet from dojo javascript, but for this part of code:
dojo.require("dojox.rpc.Rest");
var restService = dojox.rpc.Rest("http://localhost:9080/SomeApplication");
restService("/something");
I'm getting this error:
..... 127.0.0.1 9080 OPTIONS /SomeApplication/something - 405 487 0 0 http://localhost:9080 .....
HTTP Error 405 Method not allowed
What could be the problem? Why is it called OPTIONS method?
Upvotes: 0
Views: 303
Reputation: 476
The rest you work with should implement OPTIONS method for resource.
I had the same issue, in my case it was CherryPy frame work, so I added following method to my resource:
@cherrypy.expose
def OPTIONS(self):
cherrypy.response.headers['Allow'] = "GET,PUT,POST,DELETE"
Upvotes: 2