接口返回报错 resource notfound,plrase check path

  • Post author:
  • Post category:其他


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



版权声明:本文为summer089089原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。