问题描述
每当从netsuite suitescript 2.0(restlet)获得异常时,
在邮递员点击套件脚本时,能够获得如下所示的可读异常作为响应,
400错误的请求
{
"error": {
"code": "UNIQUE_CUST_ID_REQD","message": "{\"type\":\"error.SuiteScriptError\",\"name\":\"UNIQUE_CUST_ID_REQD\",\"message\":\"A customer record with this ID already exists. You must enter a unique customer ID for each record you create. To correct this record,click <a href=javascript:history.go(-1);;>back</a> and enter a new customer ID in the Customer field. Then,click Submit.\",\"stack\":[\"createError(N/error)\",\"formatandThrowException(/SuiteScripts/ns_script.js:633)\",\"createObject(/SuiteScripts/ns_script.js:523)\",\"saveObject(/SuiteScripts/ns_script.js:552)\",\"post(/SuiteScripts/ns_script.js:503)\",\"createError(N/error)\"],\"cause\":{\"name\":\"UNIQUE_CUST_ID_REQD\",click Submit.\"},\"id\":\"\",\"notifyOff\":false,\"userFacing\":true}"
}
}
但是当从春季启动中对suitescript发出相同的请求时,得到了如下图所示的不可读字符作为响应,
unreadable characters screenshot
在Spring Boot中用于调用restlet的请求标头,
[
Accept:"application/json",Content-Type:"application/json;charset=UTF-8",Authorization:"OAuth realm="<ORGANIZATION_ID>",oauth_consumer_key="<CONSUMER_KEY>",oauth_token="<TOKEN>",oauth_signature_method="HMAC-SHA256",oauth_timestamp="<TIMESTAMP>",oauth_nonce="<NONCE_VALUE>",oauth_version="1.0",oauth_signature="<OAUTH_SIGNATURE>",Content-Length:"779"
]
为什么在Spring Boot发出请求时我无法获得可读的异常信息?
预先感谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)