现在我要调用一个接口,但是一直报错,本以为是接口本身的问题,但是接口却没有问题,能够正确调试。
先看一下我的请求内容:
url::7807/openit/class_7?ServiceName=ClaimCoopreaOppor&ServiceVer=1.0&Consumer=XXX
data:{
"taskId":"1505789835011",
"userworkNum:"AA008"
}
注:JSON POST请求
再看一下返回内容:<html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Fri Sep 22 09:24:57 GMT+08:00 2017</div><div>There was an unexpected error (type=Bad Request, status=400).</div><div>Could not read document: Unexpected character ('A' (code 65)): was expecting a colon to separate field name and value at [Source: @75e074a8; line: 3, column: 16]; nested exception is : Unexpected character ('A' (code 65)): was expecting a colon to separate field name and value at [Source: @75e074a8; line: 3, column: 16]</div></body></html>
在这里返回异常,这并不是我想要的返回内容,从报错返回内容分析,
Whitelabel Error Page(报错页面)
This application has no explicit mapping for /error, so you are seeing this as a fallback(此应用程序没有显式的映射/错误,所以您将此视为回退。随便拿去翻译的,大概意思,没有专门为这个Bug做相应的处理,统一由Whitelabel Error Page显示)
Fri Sep 22 09:24:57 GMT+08:00 2017(报错发生时间)
There was an unexpected error (type=Bad Request, status=400).(有一个想不到的错误,类型:错的请求 状态码:400 看到400 以为是路径的问题,我去检查了一遍,确认URL没有错)
Could not read document: Unexpected character ('A' (code 65)): was expecting a colon to separate field name and value at [Source: @75e074a8; line: 3, column: 16]; nested exception is : Unexpected character ('A' (code 65)): was expecting a colon to separate field name and value at [Source: @75e074a8; line: 3, column: 16](这句看不什么懂,但还是知道 行 字符 字段 等等,根据现在返回的报错信息,猜想是否数据有问题。)
数据:{
"taskId":"1505789835011",
"userworkNum:"AA008"
}
{
"taskId":"1505789835011",
"userworkNum“:"AA008"
}