hmmm000 最近的时间轴更新
hmmm000

hmmm000

V2EX 第 583310 号会员,加入于 2022-05-30 14:49:02 +08:00
hmmm000 最近回复了
@RedBeanIce
String personResultAsJsonStr = null;
try {
personResultAsJsonStr = restTemplate.postForObject(url, request, String.class);

catch (HttpStatusCodeException e) {
//你要的响应体
System.out.println(e.getResponseBodyAsString());
}
resttemplate 可以通过 catch HttpStatusCodeException ,用 getResponseBodyAsString 方法获取非 200 返回的响应体。httpclient 不清楚。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2705 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 15:32 · PVG 23:32 · LAX 08:32 · JFK 11:32
Developed with CodeLauncher
♥ Do have faith in what you're doing.