类的使用
net.dongliu.cute.http.Response
-
使用Response的程序包 程序包 说明 net.dongliu.cute.http The Http APIs -
-
net.dongliu.cute.http中Response的使用
返回Response的net.dongliu.cute.http中的方法 修饰符和类型 方法 说明 <T> Response<T>ResponseContext. decodeJson(Class<T> type)Unmarshal response body as json.<T> Response<T>ResponseContext. decodeJson(Class<T> type, Charset charset)Unmarshal response body as json<T> Response<T>ResponseContext. decodeJson(net.dongliu.commons.reflect.TypeInfer<T> typeInfer)Unmarshal response body as json.<T> Response<T>ResponseContext. decodeJson(net.dongliu.commons.reflect.TypeInfer<T> typeInfer, Charset charset)Unmarshal response body as jsonResponse<Void>ResponseContext. discard()Consume and discard this response body.<T> Response<T>ResponseContext. handle(ResponseHandler<InputStream,T> responseHandler)Handle response body with handler, return a new response with content as handler result.<T> Response<T>ResponseContext. handleAsReader(ResponseHandler<Reader,T> handler)Handle response content as reader.<T> Response<T>ResponseContext. handleAsReader(ResponseHandler<Reader,T> handler, Charset charset)Handle response content as reader.Response<byte[]>ResponseContext. readToBytes()Convert to response, with body as byte arrayResponse<String>ResponseContext. readToString()Convert to response, with body as text.Response<String>ResponseContext. readToString(Charset charset)Convert to response, with body as text.Response<Void>ResponseContext. writeTo(OutputStream out)Write response body to OutputStream.Response<Void>ResponseContext. writeTo(Writer writer)Write response body to Writer, use charset detected from response header to decode response body.Response<Void>ResponseContext. writeTo(Writer writer, Charset charset)Write response body to Writer.Response<Path>ResponseContext. writeTo(Path path)Write response body to file返回变量类型为Response的类型的net.dongliu.cute.http中的方法 修饰符和类型 方法 说明 <T> CompletableFuture<Response<T>>AsyncResponseContext. decodeJson(Class<T> type)Unmarshal response body as json.<T> CompletableFuture<Response<T>>AsyncResponseContext. decodeJson(Class<T> type, Charset charset)Unmarshal response body as json.<T> CompletableFuture<Response<T>>AsyncResponseContext. decodeJson(net.dongliu.commons.reflect.TypeInfer<T> typeInfer)Unmarshal response body as json.<T> CompletableFuture<Response<T>>AsyncResponseContext. decodeJson(net.dongliu.commons.reflect.TypeInfer<T> typeInfer, Charset charset)Unmarshal response body as jsonCompletableFuture<Response<Void>>AsyncResponseContext. discard()Discard all response body.<T> CompletableFuture<Response<T>>AsyncResponseContext. handle(BodySubscriberProvider<T> subscriberProvider)Handle the response, return a response future.<T,R>
CompletableFuture<Response<R>>AsyncResponseContext. handle(BodySubscriberProvider<T> subscriberProvider, Function<? super T,? extends R> mapper)Handle the response using a BodySubscriber, then transformed the result by the function mapper.CompletableFuture<Response<byte[]>>AsyncResponseContext. readToBytes()Collect the response body to byte array.CompletableFuture<Response<String>>AsyncResponseContext. readToString()Collect the response body as String.CompletableFuture<Response<String>>AsyncResponseContext. readToString(Charset charset)Collect the response body as String.CompletableFuture<Response<Path>>AsyncResponseContext. writeTo(Path path)Write response body to file.
-