0
我想这传递到从前端的职位,但我不断收到这条线上这个错误,我想不通这是为什么字符串的索引必须是整数,而不是str的 - Django的
{"isUpdated": true}
通过这
,我有这些
body_unicode = request.body.decode('utf-8')
data = json.loads(body_unicode)
if data['isUpdated'] is not False:
# more codes
我一直对这个if data['isUpdated'] is not False:
能有人给我SUG得到错误gestions发生了什么?
也许它会将“true”编码为str。检查数据的值和数据的类型['isUpdated']' – Algorithmatic
解析这些数据之前'body_unicode'的值是多少? –
@算法值为True,类型为bol – Tsuna