Commit 217fa9a9 authored by yanzg's avatar yanzg

升级新版本

parent 0f07febc
......@@ -32,16 +32,15 @@ public class WxXcxRequestImpl implements WxXcxRequest {
}
String response;
try {
if (req instanceof WxXcxRequestPost) {
WxXcxRequestPost post = (WxXcxRequestPost) req;
if (post.isJson()) {
// 打开URL连接
java.net.HttpURLConnection httpConn = HttpHelper.getConn(url, header, true);
response = HttpHelper.post(httpConn, post.getPost(), charSet);
} else {
HttpURLConnection conn = HttpHelper.getConn(url, header);
response = HttpHelper.post(conn, post.getPost(), charSet);
}
if (req instanceof WxXcxRequestPostFormData) {
WxXcxRequestPostFormData post = (WxXcxRequestPostFormData) req;
HttpURLConnection conn = HttpHelper.getConn(url, header);
response = HttpHelper.post(conn, post.getPost(), charSet);
} else if (req instanceof WxXcxRequestPostApplication) {
WxXcxRequestPostApplication post = (WxXcxRequestPostApplication) req;
// 打开URL连接
java.net.HttpURLConnection httpConn = HttpHelper.getConn(url, header, true);
response = HttpHelper.post(httpConn, post.getPost(), charSet);
} else {
HttpURLConnection conn = HttpHelper.getConn(url, header);
response = HttpHelper.get(conn);
......
......@@ -5,14 +5,7 @@ package com.yanzuoguang.wxxcx.base;
*
* @author 颜佐光
*/
public interface WxXcxRequestPost {
/**
* 是否json
*
* @return 是否json
*/
boolean isJson();
public interface WxXcxRequestPostApplication {
/**
* 获取请求地址
......
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