MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / main

Method main

Programs/HttpsRequest.java:8–18  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

6
7public class HttpsRequest {
8 public static void main(String[] args) {
9 var request = HttpRequest.newBuilder(URI.create("https://github.com/"))
10 .GET()
11 .build();
12 //Prints the status Code of the HTTP-Request
13 HttpClient.newHttpClient()
14 .sendAsync(request, HttpResponse.BodyHandlers.ofString(Charset.defaultCharset()))
15 .thenApply(HttpResponse::statusCode)
16 .thenAccept(System.out::println)
17 .join();
18 }
19}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected