Class Response<T>


  • public class Response<T>
    extends Object
    • Constructor Detail

      • Response

        public Response()
    • Method Detail

      • success

        public static <T> Response<T> success​(T body,
                                              okhttp3.Response rawResponse)
      • error

        public static <T> Response<T> error​(Error error,
                                            okhttp3.Response rawResponse)
      • raw

        public okhttp3.Response raw()
        Returns the underlying OkHttp response object
      • code

        public int code()
        Returns the HTTP status code
      • message

        public String message()
        Returns the HTTP status message
      • isSuccessful

        public boolean isSuccessful()
        Returns true if the code is in [200..300), which means the request was successful.
      • body

        public T body()
        Returns the parsed response body for successful responses. null is returned if the response type is Void or the response has no body. For non successful response this is always null. Use {errorBody()} to get the associated error.
      • errorBody

        public Error errorBody()
        Returns an error representation for non successful responses. This is null if the response is successful.