Skip to content

Instantly share code, notes, and snippets.

@arturmkrtchyan
Last active April 25, 2017 20:50
Show Gist options
  • Save arturmkrtchyan/c1a2f91d19a349c05ee02c09242bc8f8 to your computer and use it in GitHub Desktop.
Save arturmkrtchyan/c1a2f91d19a349c05ee02c09242bc8f8 to your computer and use it in GitHub Desktop.
Java9
import jdk.incubator.http.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create("http://www.google.com")).GET().build();
HttpResponse response = client.send(request, HttpResponse.BodyHandler.asString())
System.out.println(response.body())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment