请求地址 https://1987ym.xyz/api/qqdj.php
https://1987ym.xyz/api/qqdj.php?qq=5468974621
api网页1987ym.xyz
官方论坛1987a.cn
new Thread(){
public void run() {
String path = "https://1987ym.xyz/api/qqdj.php";
String data = "?qq=5468974621";
try {
URL url = new URL(path + data);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setRequestMethod("GET");
int code = connection.getResponseCode();
if (code == 200) {
//成功
InputStreamReader isr = new InputStreamReader(connection.getInputStream());
BufferedReader bufferedreader = new BufferedReader(isr);
String string;
StringBuilder stringbuilder = new StringBuilder();
while ((string = bufferedreader.readLine()) != null) {
stringbuilder.append(string);
}
final String result = stringbuilder.toString();
System.out.println(result);
} else {
//失败
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}}.start();