Package | Description |
---|---|
java.net.http |
High level HTTP and WebSocket API
|
Modifier and Type | Method and Description |
---|---|
static HttpResponse.BodyProcessor<byte[]> |
HttpResponse.asByteArray()
Returns a
HttpResponse.BodyProcessor <byte[]> which returns the response
body as a byte array . |
static HttpResponse.BodyProcessor<Void> |
HttpResponse.asByteArrayConsumer(Consumer<byte[]> consumer)
Returns a response processor which supplies the response body to the
given Consumer.
|
static HttpResponse.BodyProcessor<Path> |
HttpResponse.asFile(Path file)
Returns a
HttpResponse.BodyProcessor <Path > where
the file is created if it does not already exist. |
static HttpResponse.BodyProcessor<Path> |
HttpResponse.asFile(Path file,
OpenOption... openOptions)
Returns a
HttpResponse.BodyProcessor <Path >. |
static HttpResponse.BodyProcessor<Path> |
HttpResponse.asFileDownload(Path directory,
OpenOption... openOptions)
Returns a
HttpResponse.BodyProcessor <Path > where
the download directory is specified, but the filename is obtained from
the Content-Disposition response header. |
static HttpResponse.BodyProcessor<InputStream> |
HttpResponse.asInputStream()
Returns a response body processor which provides an InputStream to read
the body.
|
static HttpResponse.BodyProcessor<String> |
HttpResponse.asString()
Returns a response processor which decodes the body using the character
set specified in the
Content-encoding response header. |
static HttpResponse.BodyProcessor<String> |
HttpResponse.asString(Charset charset)
Returns a
HttpResponse.BodyProcessor <String >. |
static HttpResponse.BodyProcessor<Void> |
HttpResponse.ignoreBody()
Returns a response processor which ignores the response body.
|
Modifier and Type | Method and Description |
---|---|
abstract <T> T |
HttpResponse.body(HttpResponse.BodyProcessor<T> processor)
Returns the body, blocking if necessary.
|
abstract <T> CompletableFuture<T> |
HttpResponse.bodyAsync(HttpResponse.BodyProcessor<T> processor)
Returns a
CompletableFuture of type T. |
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-ea+126