发货相关更新

This commit is contained in:
wangjinlei
2023-10-31 11:53:01 +08:00
parent 890577d545
commit f037f9c2f5
5 changed files with 51 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
package com.peanut.common.utils;
import javax.net.ssl.HttpsURLConnection;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
public class HttpsUtil {
public static String getHttps(String httpsURL) throws IOException {
URL myurl = new URL(httpsURL);
HttpsURLConnection con = (HttpsURLConnection) myurl.openConnection();
con.setRequestProperty ( "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0" );
InputStream ins = con.getInputStream();
InputStreamReader isr = new InputStreamReader(ins);
BufferedReader in = new BufferedReader(isr);
String flag = new String();
String inputLine;
while ((inputLine = in.readLine()) != null) {
flag += inputLine;
}
in.close();
return flag;
}
}