Uses of Interface
java.net.http.HttpResponse.BodyHandler
-
Packages that use HttpResponse.BodyHandler 软件包 描述 java.net.http HTTP客户端和WebSocket API -
-
Uses of HttpResponse.BodyHandler in java.net.http
Methods in java.net.http that return HttpResponse.BodyHandler 变量和类型 方法 描述 static <T> HttpResponse.BodyHandler<T>
HttpResponse.BodyHandlers. buffering(HttpResponse.BodyHandler<T> downstreamHandler, int bufferSize)
返回BodyHandler
,在调用时,返回 buffering BodySubscriber ,在将数据传递给下游订户之前缓冲数据。static HttpResponse.BodyHandler<Void>
HttpResponse.BodyHandlers. discarding()
返回丢弃响应主体的响应主体处理程序。static HttpResponse.BodyHandler<Void>
HttpResponse.BodyHandlers. fromLineSubscriber(Flow.Subscriber<? super String> subscriber)
返回一个响应体处理程序,它返回BodySubscriber
<Void>
,从BodySubscribers.fromLineSubscriber(subscriber, s -> null, charset, null)
获得,给定的为subscriber
。static <S extends Flow.Subscriber<? super String>,T>
HttpResponse.BodyHandler<T>HttpResponse.BodyHandlers. fromLineSubscriber(S subscriber, Function<? super S,? extends T> finisher, String lineSeparator)
返回响应身体处理程序返回一个BodySubscriber
<T>
从获得的BodySubscribers.fromLineSubscriber(subscriber, finisher, charset, lineSeparator)
,用给定的subscriber
,finisher
功能,和在线分离器。static HttpResponse.BodyHandler<Void>
HttpResponse.BodyHandlers. fromSubscriber(Flow.Subscriber<? super List<ByteBuffer>> subscriber)
返回一个响应体处理程序,它返回BodySubscriber
<Void>
,从HttpResponse.BodySubscribers.fromSubscriber(Subscriber)
获得,给定的为subscriber
。static <S extends Flow.Subscriber<? super List<ByteBuffer>>,T>
HttpResponse.BodyHandler<T>HttpResponse.BodyHandlers. fromSubscriber(S subscriber, Function<? super S,? extends T> finisher)
返回一个响应体处理程序,它返回BodySubscriber
<T>
获得自HttpResponse.BodySubscribers.fromSubscriber(Subscriber, Function)
,具有给定的subscriber
和finisher
函数。static HttpResponse.BodyHandler<byte[]>
HttpResponse.BodyHandlers. ofByteArray()
返回BodyHandler<byte[]>
,返回从BodySubscribers.ofByteArray()
获得的BodySubscriber
<byte[]
>。static HttpResponse.BodyHandler<Void>
HttpResponse.BodyHandlers. ofByteArrayConsumer(Consumer<Optional<byte[]>> consumer)
返回BodyHandler<Void>
返回一个BodySubscriber
<Void>
从获得BodySubscribers.ofByteArrayConsumer(Consumer)
。static HttpResponse.BodyHandler<Path>
HttpResponse.BodyHandlers. ofFile(Path file)
返回BodyHandler<Path>
,返回BodySubscriber
<Path>
。static HttpResponse.BodyHandler<Path>
HttpResponse.BodyHandlers. ofFile(Path file, OpenOption... openOptions)
返回BodyHandler<Path>
返回一个BodySubscriber
<Path>
从获得BodySubscribers.ofFile(Path,OpenOption...)
。static HttpResponse.BodyHandler<Path>
HttpResponse.BodyHandlers. ofFileDownload(Path directory, OpenOption... openOptions)
返回BodyHandler<Path>
,返回BodySubscriber
<Path
>,其中指定了下载目录,但文件名是从Content-Disposition
响应头获取的。static HttpResponse.BodyHandler<InputStream>
HttpResponse.BodyHandlers. ofInputStream()
返回BodyHandler<InputStream>
返回一个BodySubscriber
<InputStream>
从获得BodySubscribers.ofInputStream
。static HttpResponse.BodyHandler<Stream<String>>
HttpResponse.BodyHandlers. ofLines()
返回BodyHandler<Stream<String>>
返回一个BodySubscriber
<Stream<String>>
从获得BodySubscribers.ofLines(charset)
。static HttpResponse.BodyHandler<Flow.Publisher<List<ByteBuffer>>>
HttpResponse.BodyHandlers. ofPublisher()
返回BodyHandler<Publisher<List<ByteBuffer>>>
,创建一个BodySubscriber
<Publisher<List<ByteBuffer>>>
从获得BodySubscribers.ofPublisher()
。static HttpResponse.BodyHandler<String>
HttpResponse.BodyHandlers. ofString()
返回BodyHandler<String>
返回一个BodySubscriber
<String>
从获得BodySubscribers.ofString(Charset)
。static HttpResponse.BodyHandler<String>
HttpResponse.BodyHandlers. ofString(Charset charset)
返回BodyHandler<String>
返回一个BodySubscriber
<String>
从获得BodySubscribers.ofString(Charset)
。static <U> HttpResponse.BodyHandler<U>
HttpResponse.BodyHandlers. replacing(U value)
返回响应主体处理程序,在丢弃响应主体后返回给定的替换值。Methods in java.net.http with parameters of type HttpResponse.BodyHandler 变量和类型 方法 描述 static <T> HttpResponse.BodyHandler<T>
HttpResponse.BodyHandlers. buffering(HttpResponse.BodyHandler<T> downstreamHandler, int bufferSize)
返回BodyHandler
,在调用时,返回 buffering 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)
使用此客户端与给定的响应正文处理程序和推送承诺处理程序异步发送给定请求。Method parameters in java.net.http with type arguments of type HttpResponse.BodyHandler 变量和类型 方法 描述 void
HttpResponse.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)
返回推送承诺处理程序,它将推送承诺及其响应累积到给定的映射中。
-