Delete TaskManager.java

This commit is contained in:
s490122 2024-06-21 20:29:22 +02:00
parent d3b6f771b6
commit 51c11c9fdf

View File

@ -1,31 +0,0 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class TaskManager {
public static void main(String[] args) {
try {
URL url = new URL("http://localhost:8000/get_tasks");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
int status = con.getResponseCode();
if (status == 200) {
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer content = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
in.close();
con.disconnect();
System.out.println("Tasks: " + content.toString());
} else {
System.out.println("GET request failed with status: " + status);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}