I am a little baffled at the moment here is my code.
import logging
from restish import http, resource, app
from gevent import wsgi
log = logging.getLogger(__name__)
class Root(resource.Resource):
@resource.child()
def o3(self, request, segments):
return O3()
class O3(resource.Resource):
@resource.child()
def o3(self, request, segments):
return self.o3process
@resource.POST()
def o3process(self,request):
rspxml = "<human><head>Hello</head></human>"
print rspxml
return http.ok([('Content-Type', 'text/xml')],rspxml)
application = app.RestishApp(Root())
wsgi.WSGIServer(('', 8080), application, spawn=None).serve_forever()
What i do from the RESTClient(A firefox addon) i do POST on
http://127.0.0.1/o3 and i get the following response.
127.0.0.1 - - [2010-04-23 12:27:04] "POST /o3 HTTP/1.1" 200 33 "-"
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100405
Firefox/3.6.3 (Swiftfox)"
But when i do a post on
http://127.0.0.1/o3/ i get an 404 not found.
127.0.0.1 - - [2010-04-23 12:24:34] "POST /o3/ HTTP/1.1" 404 13 "-"
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100405
Firefox/3.6.3 (Swiftfox)"
What i tried using the @resource.child(resource.any) on the O3.o3 but
with the same result. What am i doing wrong?
Sam
--
You received this message because you are subscribed to the Google Groups "
ish.io" group.
To post to this group, send an email to
is...@googlegroups.com.
To unsubscribe from this group, send email to
ishio+un...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/ishio?hl=en-GB.