Is there a way to get the value of nested dict in Immutabledict sent via request of werkzeug(flask)? Is there a way to get the value of nested dict in Immutabledict sent via request of werkzeug(flask)? flask flask

Is there a way to get the value of nested dict in Immutabledict sent via request of werkzeug(flask)?


You're sending complex nested data structure as HTML form, it won't work like you expect. Encode it as JSON:

import jsonimport requestsurl = 'http://example.com/'payload = {"address": {"US": "San Francisco", "UK": "London", "CH": "Shanghai"}}data = json.dumps(payload)headers = {'Content-Type': 'application/json'}requests.post(url, data=data, headers=headers)

In you Flask app it would be accesible via request.json (already decoded).