update something..
This commit is contained in:
parent
48442d1c43
commit
a1cd537db6
@ -127,10 +127,12 @@ public class SimpleHttpClient implements HttpClient {
|
|||||||
if (request instanceof HttpEntityRequest) {
|
if (request instanceof HttpEntityRequest) {
|
||||||
httpEntity = ((HttpEntityRequest) request).getEntity();
|
httpEntity = ((HttpEntityRequest) request).getEntity();
|
||||||
connection.setUseCaches(false);
|
connection.setUseCaches(false);
|
||||||
connection.setFixedLengthStreamingMode(httpEntity
|
if (httpEntity != null) {
|
||||||
.getContentLength());
|
connection.setFixedLengthStreamingMode(httpEntity
|
||||||
connection.setRequestProperty("Content-Type", httpEntity
|
.getContentLength());
|
||||||
.getContentType().getMimeType());
|
connection.setRequestProperty("Content-Type", httpEntity
|
||||||
|
.getContentType().getMimeType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
connection.connect();
|
connection.connect();
|
||||||
// open stream
|
// open stream
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import com.foxinmy.weixin4j.http.entity.ByteArrayEntity;
|
|||||||
import com.foxinmy.weixin4j.http.entity.FileEntity;
|
import com.foxinmy.weixin4j.http.entity.FileEntity;
|
||||||
import com.foxinmy.weixin4j.http.entity.FormUrlEntity;
|
import com.foxinmy.weixin4j.http.entity.FormUrlEntity;
|
||||||
import com.foxinmy.weixin4j.http.entity.StringEntity;
|
import com.foxinmy.weixin4j.http.entity.StringEntity;
|
||||||
|
import com.foxinmy.weixin4j.model.Consts;
|
||||||
import com.foxinmy.weixin4j.util.ErrorUtil;
|
import com.foxinmy.weixin4j.util.ErrorUtil;
|
||||||
import com.foxinmy.weixin4j.util.MapUtil;
|
import com.foxinmy.weixin4j.util.MapUtil;
|
||||||
import com.foxinmy.weixin4j.util.StringUtil;
|
import com.foxinmy.weixin4j.util.StringUtil;
|
||||||
@ -194,6 +195,7 @@ public class WeixinHttpClient extends SimpleHttpClient {
|
|||||||
.replaceFirst("</retmsg>", "</return_msg>")
|
.replaceFirst("</retmsg>", "</return_msg>")
|
||||||
.replaceFirst("</root>", "</xml>");
|
.replaceFirst("</root>", "</xml>");
|
||||||
xmlResult = XmlStream.get(newXml, XmlResult.class);
|
xmlResult = XmlStream.get(newXml, XmlResult.class);
|
||||||
|
response.setContent(newXml.getBytes(Consts.UTF_8));
|
||||||
}
|
}
|
||||||
response.setXmlResult(true);
|
response.setXmlResult(true);
|
||||||
if (xmlResult.getReturnCode().equals("0")) {
|
if (xmlResult.getReturnCode().equals("0")) {
|
||||||
|
|||||||
@ -101,12 +101,12 @@ public class CustomApi extends MpApi {
|
|||||||
String text = "";
|
String text = "";
|
||||||
if (isOnline) {
|
if (isOnline) {
|
||||||
String getonlinekflist_uri = getRequestUri("getonlinekflist_uri");
|
String getonlinekflist_uri = getRequestUri("getonlinekflist_uri");
|
||||||
WeixinResponse response = weixinClient.post(String.format(getonlinekflist_uri,
|
WeixinResponse response = weixinClient.get(String.format(getonlinekflist_uri,
|
||||||
token.getAccessToken()));
|
token.getAccessToken()));
|
||||||
text = response.getAsJson().getString("kf_online_list");
|
text = response.getAsJson().getString("kf_online_list");
|
||||||
} else {
|
} else {
|
||||||
String getkflist_uri = getRequestUri("getkflist_uri");
|
String getkflist_uri = getRequestUri("getkflist_uri");
|
||||||
WeixinResponse response = weixinClient.post(String.format(getkflist_uri,
|
WeixinResponse response = weixinClient.get(String.format(getkflist_uri,
|
||||||
token.getAccessToken()));
|
token.getAccessToken()));
|
||||||
text = response.getAsJson().getString("kf_list");
|
text = response.getAsJson().getString("kf_list");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user