-
-
Save Janfy/33584b2e515a9483fbc34d58204183d5 to your computer and use it in GitHub Desktop.
JShell http client example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.http.*; | |
var client = HttpClient.newHttpClient(); | |
var uri = new URI("https://riimusolutions.com"); | |
var request = HttpRequest.newBuilder().uri(uri).build(); | |
var response = client.send(request, HttpResponse.BodyHandlers.ofString()); | |
System.out.println(response.body()); | |
/exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment