我發佈JSON到Python金字塔服務器,但我無法解析它在服務器端。Python金字塔解析JSON
POST請求是這樣的:
$.ajax({
url: "http://localhost:6543/linefollower/7/send_result",
type: "POST",
data: '{"results": [{"robot_name": "Satikas", "result": null, "team_nr": 30, "team_name": "IT Vennad", "id": 57}]}',
contentType: "application/json; charset=utf-8",
dataType: "json"
}
但在服務器端我收到這個時候我做印刷(request.body)
b'%5B%7B%22robot_name%22%3A+%22Satikas%22%2C+%22result%22%3A+null%2C+%22team_nr%22%3A+30%2C+%22team_name%22%3A+%22IT+Vennad%22%2C+%22id%22%3A+57%7D%5D='
我應該做的是能夠將發佈的內容解析爲JSON?金字塔的request.json_body何時應該包含解析的json?