Commit 217fa9a9 authored by yanzg's avatar yanzg

升级新版本

parent 0f07febc
...@@ -32,16 +32,15 @@ public class WxXcxRequestImpl implements WxXcxRequest { ...@@ -32,16 +32,15 @@ public class WxXcxRequestImpl implements WxXcxRequest {
} }
String response; String response;
try { try {
if (req instanceof WxXcxRequestPost) { if (req instanceof WxXcxRequestPostFormData) {
WxXcxRequestPost post = (WxXcxRequestPost) req; WxXcxRequestPostFormData post = (WxXcxRequestPostFormData) req;
if (post.isJson()) { HttpURLConnection conn = HttpHelper.getConn(url, header);
// 打开URL连接 response = HttpHelper.post(conn, post.getPost(), charSet);
java.net.HttpURLConnection httpConn = HttpHelper.getConn(url, header, true); } else if (req instanceof WxXcxRequestPostApplication) {
response = HttpHelper.post(httpConn, post.getPost(), charSet); WxXcxRequestPostApplication post = (WxXcxRequestPostApplication) req;
} else { // 打开URL连接
HttpURLConnection conn = HttpHelper.getConn(url, header); java.net.HttpURLConnection httpConn = HttpHelper.getConn(url, header, true);
response = HttpHelper.post(conn, post.getPost(), charSet); response = HttpHelper.post(httpConn, post.getPost(), charSet);
}
} else { } else {
HttpURLConnection conn = HttpHelper.getConn(url, header); HttpURLConnection conn = HttpHelper.getConn(url, header);
response = HttpHelper.get(conn); response = HttpHelper.get(conn);
......
...@@ -5,14 +5,7 @@ package com.yanzuoguang.wxxcx.base; ...@@ -5,14 +5,7 @@ package com.yanzuoguang.wxxcx.base;
* *
* @author 颜佐光 * @author 颜佐光
*/ */
public interface WxXcxRequestPost { public interface WxXcxRequestPostApplication {
/**
* 是否json
*
* @return 是否json
*/
boolean isJson();
/** /**
* 获取请求地址 * 获取请求地址
......
package com.yanzuoguang.wxxcx.base;
/**
* 获取请求地址
*
* @author 颜佐光
*/
public interface WxXcxRequestPostFormData {
/**
* 获取请求地址
*
* @return 请求地址
*/
String getPost();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment