标签:
public static Integer getInfo(String name) {
HttpResponse<Integer> httpResponse = null;
try {
httpResponse = Unirest.get(url) //url网址
.queryString("sn", serialNumber) //查询参数
.asObject(Integer.class); //返回类型
} catch (UnirestException e) {
logger.error(e.getMessage());
return null;
}
if (null == httpResponse || 200 != httpResponse.getStatus()) {
return null;
}
return httpResponse.getBody();
}
标签:
原文地址:http://www.cnblogs.com/guochunyi/p/5390319.html