the http.request.body data is always string, not json or python dictionary.
So I can not retrieve data from the POST request with dictionary key
What to do?
the http.request.body data is always string, not json or python dictionary.
So I can not retrieve data from the POST request with dictionary key
What to do?
Something like the following may work for you:
JSON = TypeVar('JSON')
class JSONBodyData(Component):
def resolve(body: http.request.body) -> JSON:
return json.loads(body)