インタフェース jdk.incubator.http.HttpResponse.BodyHandlerの
使用
-
HttpResponse.BodyHandlerを使用するパッケージ パッケージ 説明 jdk.incubator.http 高レベルのHTTPとWebSocket API -
-
jdk.incubator.httpでのHttpResponse.BodyHandlerの使用
HttpResponse.BodyHandlerを戻すjdk.incubator.httpのメソッド 修飾子と型 メソッド 説明 static HttpResponse.BodyHandler<byte[]>
HttpResponse.BodyHandler. asByteArray()
BodySubscriber.asByteArray()
から取得したBodySubscriber
<byte[]
>を返すBodyHandler<byte[]>
を返します。static HttpResponse.BodyHandler<Void>
HttpResponse.BodyHandler. asByteArrayConsumer(Consumer<Optional<byte[]>> consumer)
BodySubscriber.asByteArrayConsumer(Consumer)
から取得したBodySubscriber
<Void>
を返すBodyHandler<Void>
を返します。static HttpResponse.BodyHandler<Path>
HttpResponse.BodyHandler. asFile(Path file)
BodySubscriber.asFile(Path)
から取得したBodySubscriber
<Path>
を返すBodyHandler<Path>
を返します。static HttpResponse.BodyHandler<Path>
HttpResponse.BodyHandler. asFile(Path file, OpenOption... openOptions)
BodySubscriber.asFile(Path,OpenOption...)
から取得したBodySubscriber
<Path>
を返すBodyHandler<Path>
を返します。static HttpResponse.BodyHandler<Path>
HttpResponse.BodyHandler. asFileDownload(Path directory, OpenOption... openOptions)
ダウンロード・ディレクトリが指定されているBodySubscriber
<Path
>を返すBodyHandler<Path>
を返しますが、ファイル名はContent-Disposition
レスポンス・ヘッダーから取得されます。static HttpResponse.BodyHandler<InputStream>
HttpResponse.BodyHandler. asInputStream()
BodySubscriber.asInputStream
から取得したBodySubscriber
<InputStream>
を返すBodyHandler<InputStream>
を返します。static HttpResponse.BodyHandler<String>
HttpResponse.BodyHandler. asString()
BodySubscriber.asString(Charset)
から取得したBodySubscriber
<String>
を返すBodyHandler<String>
を返します。static HttpResponse.BodyHandler<String>
HttpResponse.BodyHandler. asString(Charset charset)
BodySubscriber.asString(Charset)
から取得したBodySubscriber
<String>
を返すBodyHandler<String>
を返します。static <T> HttpResponse.BodyHandler<T>
HttpResponse.BodyHandler. buffering(HttpResponse.BodyHandler<T> downstreamHandler, int bufferSize)
BodyHandler
を返します。BodyHandler
は、呼び出されるとデータをバッファリングして下流のサブスクライバに配信する「BodySubscriberをバッファリング」を返します。static <U> HttpResponse.BodyHandler<U>
HttpResponse.BodyHandler. discard(U value)
レスポンス本文を破棄し、指定された値をその代わりに使用するレスポンス本文ハンドラを返します。static HttpResponse.BodyHandler<Void>
HttpResponse.BodyHandler. fromSubscriber(Flow.Subscriber<? super List<ByteBuffer>> subscriber)
HttpResponse.BodySubscriber.fromSubscriber(Subscriber)から取得したBodySubscriber
<Void>
を、指定されたsubscriber
を返して返すレスポンス本文ハンドラを返します。static <S extends Flow.Subscriber<? super List<ByteBuffer>>,T>
HttpResponse.BodyHandler<T>HttpResponse.BodyHandler. fromSubscriber(S subscriber, Function<S,T> finisher)
指定されたsubscriber
およびfinisher
関数を使用して、HttpResponse.BodySubscriber.fromSubscriber(Subscriber, Function)
から取得したBodySubscriber
<T>
を返すレスポンス本文ハンドラを返します。HttpResponse.BodyHandler<T>
HttpResponse.MultiSubscriber. onRequest(HttpRequest request)
ユーザーからのメイン・リクエストが呼び出されます。型HttpResponse.BodyHandlerの引数を持つ型を返すjdk.incubator.httpのメソッド 修飾子と型 メソッド 説明 Optional<HttpResponse.BodyHandler<T>>
HttpResponse.MultiSubscriber. onPushPromise(HttpRequest pushPromise)
受け取ったプッシュ・プロミスごとに呼び出されます。型HttpResponse.BodyHandlerのパラメータを持つjdk.incubator.httpのメソッド 修飾子と型 メソッド 説明 static <T> HttpResponse.BodyHandler<T>
HttpResponse.BodyHandler. buffering(HttpResponse.BodyHandler<T> downstreamHandler, int bufferSize)
BodyHandler
を返します。BodyHandler
は、呼び出されるとデータをバッファリングして下流のサブスクライバに配信する「BodySubscriberをバッファリング」を返します。abstract <T> HttpResponse<T>
HttpClient. send(HttpRequest req, HttpResponse.BodyHandler<T> responseBodyHandler)
このクライアントを使用してリクエストを送信し、必要に応じてブロックしてレスポンスを取得します。abstract <T> CompletableFuture<HttpResponse<T>>
HttpClient. sendAsync(HttpRequest req, HttpResponse.BodyHandler<T> responseBodyHandler)
このクライアントと指定されたレスポンス・ハンドラを使用して、指定されたリクエストを非同期的に送信します。型HttpResponse.BodyHandlerの型引数を持つjdk.incubator.httpのメソッド・パラメータ 修飾子と型 メソッド 説明 static <V> HttpResponse.MultiSubscriber<MultiMapResult<V>,V>
HttpResponse.MultiSubscriber. asMap(Function<HttpRequest,Optional<HttpResponse.BodyHandler<V>>> reqHandler)
マルチ・レスポンス用の汎用ハンドラを返します。static <V> HttpResponse.MultiSubscriber<MultiMapResult<V>,V>
HttpResponse.MultiSubscriber. asMap(Function<HttpRequest,Optional<HttpResponse.BodyHandler<V>>> reqHandler, boolean completion)
マルチ・レスポンス用の汎用ハンドラを返します。
-