How to receive data from a POST request in frappe

try json.dumps(payload) while making the request.
and json.loads(frappe.request.data) when reading data from request.

e.g.

make request

r = requests.post(url, data=json.dumps(doc))

read request

@frappe.whitelist(allow_guest=True)
def post_test():
    return json.loads(frappe.request.data)
7 Likes