类 AsyncHTTPResponseContext


  • public class AsyncHTTPResponseContext
    extends Object
    Async Http Response.
    • 方法详细资料

      • charset

        public AsyncHTTPResponseContext charset​(Charset charset)
        Set response read charset. If not set, would get charset from response headers. If not found, would use UTF-8.
        参数:
        charset - the charset used to decode response body. Cannot be null
      • handle

        public <T> CompletableFuture<HTTPResponse<T>> handle​(AsyncHTTPResponseHandler<T> handler)
        Handle the response, return a response future. If any exceptions were thrown during call handler, will return a exceptional Future.
        类型参数:
        T - type return value type
        参数:
        handler - the response handler
      • toBinaryResponse

        public CompletableFuture<HTTPResponse<byte[]>> toBinaryResponse()
        Collect the response body to byte array.
        返回:
        the response Future