提交 117299cc 编写于 作者: J Javen205

修复 I5WMY8

上级 488c2215
...@@ -25,6 +25,7 @@ import java.util.Map; ...@@ -25,6 +25,7 @@ import java.util.Map;
public class IJPayHttpResponse implements Serializable { public class IJPayHttpResponse implements Serializable {
private static final long serialVersionUID = 6089103955998013402L; private static final long serialVersionUID = 6089103955998013402L;
private String body; private String body;
private byte[] bodyByte;
private int status; private int status;
private Map<String, List<String>> headers; private Map<String, List<String>> headers;
...@@ -36,6 +37,14 @@ public class IJPayHttpResponse implements Serializable { ...@@ -36,6 +37,14 @@ public class IJPayHttpResponse implements Serializable {
this.body = body; this.body = body;
} }
public byte[] getBodyByte() {
return bodyByte;
}
public void setBodyByte(byte[] bodyByte) {
this.bodyByte = bodyByte;
}
public int getStatus() { public int getStatus() {
return status; return status;
} }
......
...@@ -66,7 +66,11 @@ public abstract class AbstractHttpDelegate { ...@@ -66,7 +66,11 @@ public abstract class AbstractHttpDelegate {
public IJPayHttpResponse get(String url, Map<String, Object> paramMap, Map<String, String> headers) { public IJPayHttpResponse get(String url, Map<String, Object> paramMap, Map<String, String> headers) {
IJPayHttpResponse response = new IJPayHttpResponse(); IJPayHttpResponse response = new IJPayHttpResponse();
HttpResponse httpResponse = getToResponse(url, paramMap, headers); HttpResponse httpResponse = getToResponse(url, paramMap, headers);
response.setBody(httpResponse.body()); if (httpResponse.isGzip()) {
response.setBodyByte(httpResponse.bodyBytes());
} else {
response.setBody(httpResponse.body());
}
response.setStatus(httpResponse.getStatus()); response.setStatus(httpResponse.getStatus());
response.setHeaders(httpResponse.headers()); response.setHeaders(httpResponse.headers());
return response; return response;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册