import com.corn.cornhttpclient.*; public class HttpClientExample { public static void main(String[] args) { CornHttpClient client = new CornHttpClient(); CornHttpRequest request = CornHttpRequestBuilder.get("http://example.com").build(); try { CornHttpResponse response = client.execute(request); int statusCode = response.getStatusCode(); String responseBody = response.getBody(); System.out.println("Status Code: " + statusCode); System.out.println("Response Body: " + responseBody); } catch (CornHttpException e) { e.printStackTrace(); } } }


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