Class Request<T>

java.lang.Object
net.dv8tion.jda.api.requests.Request<T>
Type Parameters:
T - The expected type of the response

public class Request<T> extends Object
Internal class used for representing HTTP requests.
  • Constructor Details

    • Request

      public Request(net.dv8tion.jda.internal.requests.RestActionImpl<T> restAction, Consumer<? super T> onSuccess, Consumer<? super Throwable> onFailure, BooleanSupplier checks, boolean shouldQueue, okhttp3.RequestBody body, Object rawBody, long deadline, boolean priority, Route.CompiledRoute route, org.apache.commons.collections4.map.CaseInsensitiveMap<String,String> headers)
  • Method Details

    • onSuccess

      public void onSuccess(T successObj)
    • onFailure

      public void onFailure(Response response)
    • onRateLimited

      public void onRateLimited(Response response)
    • createErrorResponseException

      @Nonnull public ErrorResponseException createErrorResponseException(@Nonnull Response response)
    • onFailure

      public void onFailure(Throwable failException)
    • onCancelled

      public void onCancelled()
    • onTimeout

      public void onTimeout()
    • getJDA

      @Nonnull public net.dv8tion.jda.internal.JDAImpl getJDA()
    • getRestAction

      @Nonnull public RestAction<T> getRestAction()
    • getOnSuccess

      @Nonnull public Consumer<? super T> getOnSuccess()
    • getOnFailure

      @Nonnull public Consumer<? super Throwable> getOnFailure()
    • isPriority

      public boolean isPriority()
    • isSkipped

      public boolean isSkipped()
    • getHeaders

      @Nullable public org.apache.commons.collections4.map.CaseInsensitiveMap<String,String> getHeaders()
    • getRoute

      @Nonnull public Route.CompiledRoute getRoute()
    • getBody

      @Nullable public okhttp3.RequestBody getBody()
    • getRawBody

      @Nullable public Object getRawBody()
    • shouldQueue

      public boolean shouldQueue()
    • cancel

      public void cancel()
    • isCancelled

      public boolean isCancelled()
    • handleResponse

      public void handleResponse(@Nonnull Response response)