|
|
@@ -1,5 +1,6 @@ |
|
|
|
package me.chanjar.weixin.mp.util.http.jodd; |
|
|
|
|
|
|
|
import com.google.common.collect.ImmutableMap; |
|
|
|
import jodd.http.HttpConnectionProvider; |
|
|
|
import jodd.http.HttpRequest; |
|
|
|
import jodd.http.HttpResponse; |
|
|
@@ -9,6 +10,7 @@ import jodd.util.StringPool; |
|
|
|
import me.chanjar.weixin.common.bean.result.WxError; |
|
|
|
import me.chanjar.weixin.common.exception.WxErrorException; |
|
|
|
import me.chanjar.weixin.common.util.http.RequestHttp; |
|
|
|
import me.chanjar.weixin.common.util.json.WxGsonBuilder; |
|
|
|
import me.chanjar.weixin.mp.bean.material.WxMpMaterialNews; |
|
|
|
import me.chanjar.weixin.mp.util.http.MaterialNewsInfoRequestExecutor; |
|
|
|
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; |
|
|
@@ -28,13 +30,13 @@ public class JoddMaterialNewsInfoRequestExecutor extends MaterialNewsInfoRequest |
|
|
|
|
|
|
|
@Override |
|
|
|
public WxMpMaterialNews execute(String uri, String materialId) throws WxErrorException, IOException { |
|
|
|
HttpRequest request = HttpRequest.post(uri); |
|
|
|
if (requestHttp.getRequestHttpProxy() != null) { |
|
|
|
requestHttp.getRequestHttpClient().useProxy(requestHttp.getRequestHttpProxy()); |
|
|
|
} |
|
|
|
request.withConnectionProvider(requestHttp.getRequestHttpClient()); |
|
|
|
|
|
|
|
request.query("media_id", materialId); |
|
|
|
HttpRequest request = HttpRequest.post(uri) |
|
|
|
.withConnectionProvider(requestHttp.getRequestHttpClient()) |
|
|
|
.body(WxGsonBuilder.create().toJson(ImmutableMap.of("media_id", materialId))); |
|
|
|
HttpResponse response = request.send(); |
|
|
|
response.charset(StringPool.UTF_8); |
|
|
|
|
|
|
|