インタフェースjava.net.http.HttpResponse.BodyHandlerの
使用
HttpResponse.BodyHandlerを使用するパッケージ
-
java.net.httpでのHttpResponse.BodyHandlerの使用
修飾子と型メソッド説明static <T> HttpResponse.BodyHandler<T> HttpResponse.BodyHandlers.buffering(HttpResponse.BodyHandler<T> downstreamHandler, int bufferSize) BodyHandlerを返します。BodyHandlerは、呼び出されるとデータをバッファリングして下流のサブスクライバに配信する「BodySubscriberをバッファリング」を返します。static HttpResponse.BodyHandler<Void> HttpResponse.BodyHandlers.discarding()レスポンス本文を破棄するレスポンス本文ハンドラを返します。static HttpResponse.BodyHandler<Void> HttpResponse.BodyHandlers.fromLineSubscriber(Flow.Subscriber<? super String> subscriber) 指定されたBodySubscribers.fromLineSubscriber(subscriber, s -> null, charset, null)から取得されたBodySubscriber<Void>を返すレスポンス本文ハンドラを返します。static <S extends Flow.Subscriber<? super String>,T>
HttpResponse.BodyHandler<T> HttpResponse.BodyHandlers.fromLineSubscriber(S subscriber, Function<? super S, ? extends T> finisher, String lineSeparator) BodySubscribers.fromLineSubscriber(subscriber, finisher, charset, lineSeparator)から取得したBodySubscriber<T>を返し、指定されたsubscriber、finisher関数および行セパレータを含むレスポンス本文ハンドラを返します。static HttpResponse.BodyHandler<Void> HttpResponse.BodyHandlers.fromSubscriber(Flow.Subscriber<? super List<ByteBuffer>> subscriber) 指定されたHttpResponse.BodySubscribers.fromSubscriber(Subscriber)から取得されたBodySubscriber<Void>を返すレスポンス本文ハンドラを返します。static <S extends Flow.Subscriber<? super List<ByteBuffer>>,T>
HttpResponse.BodyHandler<T> HttpResponse.BodyHandlers.fromSubscriber(S subscriber, Function<? super S, ? extends T> finisher) 指定されたsubscriberおよびfinisher関数を使用して、HttpResponse.BodySubscribers.fromSubscriber(Subscriber, Function)から取得されたBodySubscriber<T>を返すレスポンス本文ハンドラを返します。static HttpResponse.BodyHandler<byte[]> HttpResponse.BodyHandlers.ofByteArray()BodySubscribers.ofByteArray()から取得したBodySubscriber<byte[]>を返すBodyHandler<byte[]>を返します。static HttpResponse.BodyHandler<Void> HttpResponse.BodyHandlers.ofByteArrayConsumer(Consumer<Optional<byte[]>> consumer) BodySubscribers.ofByteArrayConsumer(Consumer)から取得されたBodySubscriber<Void>を返すBodyHandler<Void>を返します。static HttpResponse.BodyHandler<Path> BodySubscriber<Path>を返すBodyHandler<Path>を返します。static HttpResponse.BodyHandler<Path> HttpResponse.BodyHandlers.ofFile(Path file, OpenOption... openOptions) BodySubscribers.ofFile(Path,OpenOption...)から取得されたBodySubscriber<Path>を返すBodyHandler<Path>を返します。static HttpResponse.BodyHandler<Path> HttpResponse.BodyHandlers.ofFileDownload(Path directory, OpenOption... openOptions) ダウンロード・ディレクトリが指定されているが、ファイル名がContent-Dispositionレスポンス・ヘッダーから取得されるBodySubscriber<Path> を返すBodyHandler<Path>を返します。static HttpResponse.BodyHandler<InputStream> HttpResponse.BodyHandlers.ofInputStream()BodySubscribers.ofInputStreamから取得されたBodySubscriber<InputStream>を返すBodyHandler<InputStream>を返します。static HttpResponse.BodyHandler<Stream<String>> HttpResponse.BodyHandlers.ofLines()BodySubscribers.ofLines(charset)から取得されたBodySubscriber<Stream<String>>を返すBodyHandler<Stream<String>>を返します。static HttpResponse.BodyHandler<Flow.Publisher<List<ByteBuffer>>> HttpResponse.BodyHandlers.ofPublisher()BodySubscribers.ofPublisher()から取得したBodySubscriber<Publisher<List<ByteBuffer>>>を作成するBodyHandler<Publisher<List<ByteBuffer>>>を返します。static HttpResponse.BodyHandler<String> HttpResponse.BodyHandlers.ofString()BodySubscribers.ofString(Charset)から取得されたBodySubscriber<String>を返すBodyHandler<String>を返します。static HttpResponse.BodyHandler<String> BodySubscribers.ofString(Charset)から取得されたBodySubscriber<String>を返すBodyHandler<String>を返します。static <U> HttpResponse.BodyHandler<U> HttpResponse.BodyHandlers.replacing(U value) レスポンス本文を破棄した後、指定された置換値を返すレスポンス本文ハンドラを返します。型HttpResponse.BodyHandlerのパラメータを持つjava.net.httpのメソッド修飾子と型メソッド説明static <T> HttpResponse.BodyHandler<T> HttpResponse.BodyHandlers.buffering(HttpResponse.BodyHandler<T> downstreamHandler, int bufferSize) BodyHandlerを返します。BodyHandlerは、呼び出されるとデータをバッファリングして下流のサブスクライバに配信する「BodySubscriberをバッファリング」を返します。abstract <T> HttpResponse<T> HttpClient.send(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler) このクライアントを使用して指定されたリクエストを送信し、必要に応じてブロックしてレスポンスを取得します。abstract <T> CompletableFuture<HttpResponse<T>> HttpClient.sendAsync(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler) 指定されたレスポンス本文ハンドラとともに、このクライアントを使用して、指定されたリクエストを非同期に送信します。abstract <T> CompletableFuture<HttpResponse<T>> HttpClient.sendAsync(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler, HttpResponse.PushPromiseHandler<T> pushPromiseHandler) 指定されたレスポンス本文ハンドラとともにこのクライアントを使用して、指定されたリクエストを非同期に送信し、プッシュ・プロミス・ハンドラをプッシュします。型HttpResponse.BodyHandlerの型引数を持つjava.net.httpのメソッド・パラメータ修飾子と型メソッド説明voidHttpResponse.PushPromiseHandler.applyPushPromise(HttpRequest initiatingRequest, HttpRequest pushPromiseRequest, Function<HttpResponse.BodyHandler<T>, CompletableFuture<HttpResponse<T>>> acceptor) 受信プッシュ・プロミスの通知。static <T> HttpResponse.PushPromiseHandler<T> HttpResponse.PushPromiseHandler.of(Function<HttpRequest, HttpResponse.BodyHandler<T>> pushPromiseHandler, ConcurrentMap<HttpRequest, CompletableFuture<HttpResponse<T>>> pushPromisesMap) 指定されたマップに、プッシュ・プロミスおよびそのレスポンスを累積する、プッシュ・プロミス・ハンドラを返します。