# HG changeset patch # User chegar # Date 1518168404 0 # Node ID e1890248eafe56335f2dc96e03ab4a0c09913b96 # Parent 15dc43936d39f64cbd88e600aa84c6d2d3694560 http-client-branch: minor doc cleanup diff -r 15dc43936d39 -r e1890248eafe src/java.net.http/share/classes/java/net/http/HttpClient.java --- a/src/java.net.http/share/classes/java/net/http/HttpClient.java Thu Feb 08 20:58:35 2018 +0000 +++ b/src/java.net.http/share/classes/java/net/http/HttpClient.java Fri Feb 09 09:26:44 2018 +0000 @@ -59,7 +59,14 @@ *

An {@code HttpClient} provides configuration information, and resource * sharing, for all requests send through it. * - *

Requests can be made either synchronously or asynchronously: + *

A {@linkplain BodyHandler BodyHandler} must be supplied for each {@link + * HttpRequest} sent. The {@code BodyHandler} determines how to handle the + * response body, if any. Once an {@linkplain HttpResponse} is received, the + * headers, response code, and body (typically) are available. Whether the + * response body bytes has been read or not depends on the type {@code } of + * the response body. + * + *

Requests can be sent either synchronously or asynchronously: *

* - *

A {@linkplain BodyHandler BodyHandler} must be supplied for each {@code - * HttpRequest} sent. The {@code BodyHandler} determines how to handle the - * response body, if any. Once an {@linkplain HttpResponse} is received, the - * headers, response code, and body (typically) are available. Whether the - * response body bytes has been read or not depends on the type {@code } of - * the response body. - * *

Synchronous Example *

{@code    HttpClient client = HttpClient.newBuilder()
  *        .version(Version.HTTP_1)
@@ -100,8 +100,7 @@
  *        .build();
  *   client.sendAsync(request, BodyHandler.asString())
  *        .thenApply(HttpResponse::body)
- *        .thenAccept(System.out::println)
- *        .join();  }
+ * .thenAccept(System.out::println); } * *

Security checks *