parent
f7dee16f53
commit
6ede312510
|
@ -75,13 +75,19 @@ public class RestfulInterface {
|
||||||
httpHeadMap.put(String.valueOf(Header.CONNECTION), "keep-alive");
|
httpHeadMap.put(String.valueOf(Header.CONNECTION), "keep-alive");
|
||||||
httpHeadMap.put(String.valueOf(Header.ACCEPT), "*/*");
|
httpHeadMap.put(String.valueOf(Header.ACCEPT), "*/*");
|
||||||
|
|
||||||
String svrResp = postJson(url, httpHeadMap, OBJECT_MAPPER.writeValueAsString(obj));
|
String reqJson = OBJECT_MAPPER.writeValueAsString(obj);
|
||||||
|
|
||||||
|
log.debug("Restful request: {}: {}", url, reqJson);
|
||||||
|
|
||||||
|
String svrResp = postJson(url, httpHeadMap, reqJson);
|
||||||
|
|
||||||
if (svrResp == null) {
|
if (svrResp == null) {
|
||||||
log.debug("Server return null: {}", url);
|
log.debug("Server return null: {}", url);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.debug("Restful response: {}: {}", url, svrResp);
|
||||||
|
|
||||||
return OBJECT_MAPPER.readValue(svrResp, outType);
|
return OBJECT_MAPPER.readValue(svrResp, outType);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
log.debug("System exception: ", e);
|
log.debug("System exception: ", e);
|
||||||
|
@ -116,7 +122,7 @@ public class RestfulInterface {
|
||||||
|
|
||||||
String reqJson = OBJECT_MAPPER.writeValueAsString(obj);
|
String reqJson = OBJECT_MAPPER.writeValueAsString(obj);
|
||||||
|
|
||||||
log.debug("PengXin request: {}, {}: {}", url, token, reqJson);
|
log.debug("Restful request: {}, {}: {}", url, token, reqJson);
|
||||||
|
|
||||||
switch (reqType) {
|
switch (reqType) {
|
||||||
case GET:
|
case GET:
|
||||||
|
@ -135,7 +141,7 @@ public class RestfulInterface {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug("PengXin response: {}, {}: {}", url, token, svrResp);
|
log.debug("Restful response: {}, {}: {}", url, token, svrResp);
|
||||||
|
|
||||||
return OBJECT_MAPPER.readValue(svrResp,
|
return OBJECT_MAPPER.readValue(svrResp,
|
||||||
new TypeReference<ProtocolRespDTO<T>>() {
|
new TypeReference<ProtocolRespDTO<T>>() {
|
||||||
|
|
Loading…
Reference in New Issue