Package kong.unirest

Interface Client

  • All Known Implementing Classes:
    JavaClient

    public interface Client
    • Method Detail

      • getClient

        <T> T getClient()
        Type Parameters:
        T - the underlying client
        Returns:
        the underlying client if this instance is wrapping another library.
      • request

        @Deprecated
        <T> HttpResponse<T> request​(HttpRequest request,
                                    Function<RawResponse,​HttpResponse<T>> transformer)
        Deprecated.
        use the version with the resultType
        Make a request
        Type Parameters:
        T - The type of the body
        Parameters:
        request - the prepared request object
        transformer - the function to transform the response
        Returns:
        a HttpResponse with a transformed body
      • request

        default <T> HttpResponse<T> request​(HttpRequest request,
                                            Function<RawResponse,​HttpResponse<T>> transformer,
                                            Class<?> resultType)
        Make a request
        Type Parameters:
        T - The type of the body
        Parameters:
        request - the prepared request object
        transformer - the function to transform the response
        resultType - the final body result type. This is a hint to downstream systems to make up for type erasure.
        Returns:
        a HttpResponse with a transformed body
      • request

        <T> CompletableFuture<HttpResponse<T>> request​(HttpRequest request,
                                                       Function<RawResponse,​HttpResponse<T>> transformer,
                                                       CompletableFuture<HttpResponse<T>> callback,
                                                       Class<?> resultType)
        Make a Async request
        Type Parameters:
        T - The type of the body
        Parameters:
        request - the prepared request object
        transformer - the function to transform the response
        callback - the CompletableFuture that will handle the eventual response
        resultType - the final body result type. This is a hint to downstream systems to make up for type erasure.
        Returns:
        a CompletableFuture of a response