|
@@ -36,7 +36,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
/**
|
|
|
* 通用http发送方法
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
*/
|
|
|
public class HttpUtils {
|
|
@@ -54,6 +54,16 @@ public class HttpUtils {
|
|
|
httpPost.setHeader("u-token", accessToken);
|
|
|
}
|
|
|
httpPost.setHeader("Content-Type", "application/json");
|
|
|
+ httpPost.setHeader("Accept", "*/*");
|
|
|
+ httpPost.setHeader("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8");
|
|
|
+ httpPost.setHeader("Connection", "keep-alive");
|
|
|
+ httpPost.setHeader("Origin", "https://pv4y-pc.youzy.cn");
|
|
|
+ httpPost.setHeader("Referer", "https://pv4y-pc.youzy.cn");
|
|
|
+ httpPost.setHeader("Sec-Fetch-Dest", "empty");
|
|
|
+ httpPost.setHeader("Sec-Fetch-Mode", "cors");
|
|
|
+ httpPost.setHeader("Sec-Fetch-Site", "same-site");
|
|
|
+ httpPost.setHeader("Accept", "*");
|
|
|
+ httpPost.setHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36");
|
|
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
|
|
String result = "";
|
|
|
int statusCode = response.getStatusLine().getStatusCode();
|
|
@@ -64,7 +74,7 @@ public class HttpUtils {
|
|
|
result = EntityUtils.toString(httpEntity);
|
|
|
}
|
|
|
}else {
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
return result;
|
|
|
} catch (Exception e) {
|
|
@@ -73,7 +83,6 @@ public class HttpUtils {
|
|
|
}
|
|
|
return "";
|
|
|
}
|
|
|
-
|
|
|
public static String postBody(String postUrl, String body, String uSign) {
|
|
|
return postBody(postUrl, body, uSign, null);
|
|
|
}
|
|
@@ -83,7 +92,7 @@ public class HttpUtils {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ *
|
|
|
* @param url
|
|
|
* @param param
|
|
|
* @return
|
|
@@ -292,4 +301,4 @@ public class HttpUtils {
|
|
|
}
|
|
|
return def;
|
|
|
}
|
|
|
-}
|
|
|
+}
|