Created
May 13, 2020 07:59
-
-
Save gatanaso/cc5e65b99c5d7b8786e2d38d0bc1bb05 to your computer and use it in GitHub Desktop.
JShell http client example
This file contains hidden or 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