Object of type ‘CaseInsensitiveDict‘ is not JSON serializable

在调试代码过程中,发现 一个报错:Object of type ‘CaseInsensitiveDict‘ is not JSON serializable


<class 'dict'>

{'R': '{"a": "111", "b": {"c": [1, 123], "d": "01"}}',

'RD': "\n[status_code]:200\n\n[header]:{'Date': 'Mon, 24 Oct 2022 13:35:42 GMT', 'Server': 'WSGIServer/0.2 CPython/3.6.8', 'Content-Type': 'application/json', 'Content-Length': '44', 'Vary': 'Origin', 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'same-origin'}\n",

'CR': '【新配置】 = False',

'TQ': {},

'REPORT': {'label': 'dlz', 'result': False, 'method': 'get', 'url': 'http://localhost:8000/test_a/?', 'request_headers': {}, 'payload_method': 'x-www-form-urlencode', 'payload_raw_method': '', 'payload': '{"payload_fd": [{"key": "ddd", "value": "777", "des": "\\u6d4b\\u8bd5"}], "payload_xwfu": [], "payload_raw": "", "payload_GQL_q": "333", "payload_GQL_g": "444"}', 'status_code': 200, 'response_header': {'Date': 'Mon, 24 Oct 2022 13:35:42 GMT', 'Server': 'WSGIServer/0.2 CPython/3.6.8', 'Content-Type': 'application/json', 'Content-Length': '44', 'Vary': 'Origin', 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'same-origin'},

'R': '{"a": "111", "b": {"c": [1, 123], "d": "01"}}',

'CR': '【新配置】 = False',

'TQ': {}}

}

{'R': '{"a": "111", "b": {"c": [1, 123], "d": "01"}}',

'RD': "\n[status_code]:200\n\n[header]:{'Date': 'Mon, 24 Oct 2022 13:35:42 GMT', 'Server': 'WSGIServer/0.2 CPython/3.6.8', 'Content-Type': 'application/json', 'Content-Length': '44', 'Vary': 'Origin', 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'same-origin'}\n",

'CR': '【新配置】 = False',

'TQ': {},

'REPORT': {'label': 'dlz', 'result': False, 'method': 'get', 'url': 'http://localhost:8000/test_a/?', 'request_headers': {}, 'payload_method': 'x-www-form-urlencode', 'payload_raw_method': '', 'payload': '{"payload_fd": [{"key": "ddd", "value": "777", "des": "\\u6d4b\\u8bd5"}], "payload_xwfu": [], "payload_raw": "", "payload_GQL_q": "333", "payload_GQL_g": "444"}', 'status_code': 200, 'response_header': {'Date': 'Mon, 24 Oct 2022 13:35:42 GMT', 'Server': 'WSGIServer/0.2 CPython/3.6.8', 'Content-Type': 'application/json', 'Content-Length': '44', 'Vary': 'Origin', 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'same-origin'},

'R': '{"a": "111", "b": {"c": [1, 123], "d": "01"}}',

'CR': '【新配置】 = False',

'TQ': {}}

}

经过排查发现,原来是红色部分的value值不是字符串格式,将红色部分转换成string格式即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值