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