aws / aws/chalice

Chalice Testing issue for POST request in Blueprint

Open
#1,908 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

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(, {'/realtime/inference/v1/{team}/{model}': {'GET': }, '/': {'**GET**': }, '/index': {'**POST**': }})

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.