As many as HTTP frameworks support using the custom method and custom HTTP status code to be used inside the codes, I wonder that is it possible to do the same thing with Falcon?
I tried:
class MyResource:
def on_obtain(self, req, resp):
# do some thing
and I also add it to the API
routes, but when I call this API I get HTTP/1.1 400 Bad Request
with this body:
{"title":"Bad request","description":"Invalid HTTP method"}
my question is that is it possible to define obtain
on this resource?
I think you need to use Custom Routers. Just an example:
Let's check:
So, all what you need is just create
Router
and implementadd_route()
/find()
methods. Hope you understand what I mean.