Package com.auth0.net

Interface Request<T>

Type Parameters:
T - the type of payload expected in the response after the execution.
All Known Subinterfaces:
AuthRequest, SignUpRequest
All Known Implementing Classes:
BaseRequest, CreateUserRequest, CustomRequest, EmptyBodyRequest, FormBodyRequest, MultipartRequest, TokenRequest, VoidRequest

public interface Request<T>
Class that represents an HTTP Request that can be executed.
  • Method Summary

    Modifier and Type
    Method
    Description
    Executes this request synchronously.
    Executes this request asynchronously.
  • Method Details

    • execute

      T execute() throws Auth0Exception
      Executes this request synchronously.
      Returns:
      the response body JSON decoded as T
      Throws:
      APIException - if the request was executed but the response wasn't successful.
      Auth0Exception - if the request couldn't be created or executed successfully.
    • executeAsync

      default CompletableFuture<T> executeAsync()
      Executes this request asynchronously. Note: This method was added after the interface was released in version 1.0. It is defined as a default method for compatibility reasons. From version 2.0 on, the method will be abstract and all implementations of this interface will have to provide their own implementation. The default implementation throws an UnsupportedOperationException.
      Returns:
      a CompletableFuture representing the specified request.