Package com.auth0.net

Interface Request<T>

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

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

    • execute

      Response<T> execute() throws Auth0Exception
      Executes this request synchronously.
      Returns:
      a Response containing information about the response.
      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

      CompletableFuture<Response<T>> executeAsync()
      Executes this request asynchronously.
      Returns:
      a CompletableFuture representing the specified request.
    • addHeader

      Request<T> addHeader(String name, String value)
      Adds an HTTP header to the request
      Parameters:
      name - the name of the header
      value - the value of the header
      Returns:
      this same request instance
    • addParameter

      Request<T> addParameter(String name, Object value)
      Adds an body parameter to the request
      Parameters:
      name - the name of the parameter
      value - the value of the parameter
      Returns:
      this same request instance
    • setBody

      Request<T> setBody(Object body)
      Sets the response's body directly
      Parameters:
      body - the value to set as body
      Returns:
      this same request instance