Request POST data parsed as string not JSON/dict


#1

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?


#2

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)