Chalice Testing issue for POST request in Blueprint
When I was trying to test a POST method from Blue Print the RestAPIEventHandler class routes are always GET so as a result I am always getting "Unsupported Method POST" from _main_rest_api_handler method in app.py. But if I move my method from bluprint module to main app.py then it works fine also when I deploy the app all looks ok and it work perfectly.
Blueprint function :
@singleRealTime.route("/", methods=["POST"]) def index(): return singleRealTime.current_request.json_body
Application Function:
@singleRealTime.route("/index", methods=["POST"]) def index(): return singleRealTime.current_request.json_body
Return Routes :
defaultdict(<class 'dict'>, {'/realtime/inference/v1/{team}/{model}': {'GET': <chalice.app.RouteEntry object at 0x7fd97d938a90>}, '/': {'GET': <chalice.app.RouteEntry object at 0x7fd97d938b10>}, '/index': {'POST': <chalice.app.RouteEntry object at 0x7fd97d938dd0>}})
I'm also seeing this behavior. Working on digging into the problem. Did you find anything @surajitkundu-dazn?
I'm also seeing this behavior. Working on digging into the problem. Did you find anything @surajitkundu-dazn?
Not yet , Right mow I am testing my POST method as GET in test script. Which is a problem because I have a route where GET and POST both the methods are present