Package com.auth0.net

Class BaseRequest<T>

java.lang.Object
com.auth0.net.BaseRequest<T>
All Implemented Interfaces:
Request<T>
Direct Known Subclasses:
CustomRequest, MultipartRequest

public abstract class BaseRequest<T> extends Object implements Request<T>
  • Method Details

    • createRequest

      protected abstract okhttp3.Request createRequest() throws Auth0Exception
      Throws:
      Auth0Exception
    • parseResponse

      protected abstract T parseResponse(okhttp3.Response response) throws Auth0Exception
      Throws:
      Auth0Exception
    • execute

      public T execute() throws Auth0Exception
      Executes this request.
      Specified by:
      execute in interface Request<T>
      Returns:
      the response body JSON decoded as T
      Throws:
      Auth0Exception - if the request execution fails.
    • executeAsync

      public CompletableFuture<T> executeAsync()
      Description copied from interface: Request
      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.
      Specified by:
      executeAsync in interface Request<T>
      Returns:
      a CompletableFuture representing the specified request.