1.报错原因
post请求的content-type : application/x-www-form-urlencoded 但是请求体中设置的是json数据。
{"date":"2022-01-01","inclTransfer":"Y","endDate":"2022-01-31","accbookCode":["JT0001"],"allEndLevel":"N","inclError":"Y","startSubjLevel":"1","inclUntallyed":"Y","queryByPeriod":"N","isOffChartAcc":"N","currtypeCode":"本币","endSubjLevel":"1","inclReclassify":"N","startSubjCode":"1001","endSubjCode":"1001"}
导致服务器不能正确解析body中的值,因此报错。
2.问题解决
将请求头中的 content-type : application/x-www-form-urlencoded 更改为 content-type : application/json