import com.tophe.HttpRequest; import com.tophe.HttpResponse; import com.tophe.TopheClient; public class Main { public static void main(String[] args) { TopheClient client = new TopheClient(); HttpRequest request = new HttpRequest.Builder() .url("https://example.com/api/data") .method("GET") .build(); HttpResponse response = client.execute(request); if (response.isSuccessful()) { String responseBody = response.body().string(); System.out.println("Response Body: " + responseBody); } else { System.out.println("Request failed with response code: " + response.code()); } } }


上一篇:
下一篇:
切换中文