python出現JSON解析出錯的問題:‘message‘: “JSON parse error: Unrecognized token ‘adminUserId‘: was expecting (J
阿新 • • 發佈:2020-10-23
報錯資訊:{‘timestamp’: ‘2020-10-22 22:38:12’, ‘status’: 400, ‘error’: ‘Bad Request’, ‘message’: “JSON parse error: Unrecognized token ‘adminUserId’: was expecting (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token ‘adminUserId’: was expecting (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’)\n at [Source: (PushbackInputStream); line: 1, column: 13]”, ‘path’: ‘/admin/login’}
原因:傳送請求的時候,關注request headers 的content-type, content-type決定輸入引數格式
改為json=params後,這一步執行成功。