类的使用
net.dongliu.cute.http.HTTPResponse
-
使用HTTPResponse的程序包 程序包 说明 net.dongliu.cute.http The Http APIs -
-
net.dongliu.cute.http中HTTPResponse的使用
返回HTTPResponse的net.dongliu.cute.http中的方法 修饰符和类型 方法 说明 <T> HTTPResponse<T>HTTPResponseContext. decodeJson(Class<T> type)Unmarshal response body as json.<T> HTTPResponse<T>HTTPResponseContext. decodeJson(Class<T> type, Charset charset)Unmarshal response body as json<T> HTTPResponse<T>HTTPResponseContext. decodeJson(net.dongliu.commons.reflect.TypeInfer<T> typeInfer)Unmarshal response body as json.<T> HTTPResponse<T>HTTPResponseContext. decodeJson(net.dongliu.commons.reflect.TypeInfer<T> typeInfer, Charset charset)Unmarshal response body as jsonHTTPResponse<Void>HTTPResponseContext. discard()Consume and discard this response body.<T> HTTPResponse<T>HTTPResponseContext. handle(HTTPResponseHandler<InputStream,T> responseHandler)Handle response body with handler, return a new response with content as handler result.<T> HTTPResponse<T>HTTPResponseContext. handleAsReader(HTTPResponseHandler<Reader,T> handler)Handle response content as reader.<T> HTTPResponse<T>HTTPResponseContext. handleAsReader(HTTPResponseHandler<Reader,T> handler, Charset charset)Handle response content as reader.HTTPResponse<byte[]>HTTPResponseContext. readToBytes()Convert to response, with body as byte arrayHTTPResponse<String>HTTPResponseContext. readToString()Convert to response, with body as text.HTTPResponse<String>HTTPResponseContext. readToString(Charset charset)Convert to response, with body as text.<R> HTTPResponse<R>HTTPResponse. transform(Function<T,R> transformer)Return a new Response, with body is the result apply transformer on the original response body.HTTPResponse<Void>HTTPResponseContext. writeTo(OutputStream out)Write response body to OutputStream.HTTPResponse<Void>HTTPResponseContext. writeTo(Writer writer)Write response body to Writer, use charset detected from response header to decode response body.HTTPResponse<Void>HTTPResponseContext. writeTo(Writer writer, Charset charset)Write response body to Writer.HTTPResponse<Path>HTTPResponseContext. writeTo(Path path)Write response body to file返回变量类型为HTTPResponse的类型的net.dongliu.cute.http中的方法 修饰符和类型 方法 说明 <T> CompletableFuture<HTTPResponse<T>>AsyncHTTPResponseContext. decodeJson(Class<T> type)Unmarshal response body as json.<T> CompletableFuture<HTTPResponse<T>>AsyncHTTPResponseContext. decodeJson(Class<T> type, Charset charset)Unmarshal response body as json.<T> CompletableFuture<HTTPResponse<T>>AsyncHTTPResponseContext. decodeJson(net.dongliu.commons.reflect.TypeInfer<T> typeInfer)Unmarshal response body as json.<T> CompletableFuture<HTTPResponse<T>>AsyncHTTPResponseContext. decodeJson(net.dongliu.commons.reflect.TypeInfer<T> typeInfer, Charset charset)Unmarshal response body as jsonCompletableFuture<HTTPResponse<Void>>AsyncHTTPResponseContext. discard()Discard all response body.<T> CompletableFuture<HTTPResponse<T>>AsyncHTTPResponseContext. handle(BodySubscriberProvider<T> subscriberProvider)Handle the response, return a response future.<T,R>
CompletableFuture<HTTPResponse<R>>AsyncHTTPResponseContext. 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<HTTPResponse<byte[]>>AsyncHTTPResponseContext. readToBytes()Collect the response body to byte array.CompletableFuture<HTTPResponse<String>>AsyncHTTPResponseContext. readToString()Collect the response body as String.CompletableFuture<HTTPResponse<String>>AsyncHTTPResponseContext. readToString(Charset charset)Collect the response body as String.CompletableFuture<HTTPResponse<Path>>AsyncHTTPResponseContext. writeTo(Path path)Write response body to file.
-