public final class Response<T> extends Object
Modifier and Type | Method and Description |
---|---|
T |
body()
The deserialized response body of a successful response.
|
int |
code()
HTTP status code.
|
static <T> Response<T> |
error(int code,
com.squareup.okhttp.ResponseBody body)
TODO
|
static <T> Response<T> |
error(com.squareup.okhttp.ResponseBody body,
com.squareup.okhttp.Response rawResponse)
TODO
|
com.squareup.okhttp.ResponseBody |
errorBody()
The raw response body of an unsuccessful response.
|
com.squareup.okhttp.Headers |
headers() |
boolean |
isSuccess()
true if code() is in the range [200..300). |
String |
message()
HTTP status message.
|
com.squareup.okhttp.Response |
raw()
The raw response from the HTTP client.
|
static <T> Response<T> |
success(T body)
TODO
|
static <T> Response<T> |
success(T body,
com.squareup.okhttp.Response rawResponse)
TODO
|
public static <T> Response<T> success(T body)
public static <T> Response<T> success(T body, com.squareup.okhttp.Response rawResponse)
public static <T> Response<T> error(int code, com.squareup.okhttp.ResponseBody body)
public static <T> Response<T> error(com.squareup.okhttp.ResponseBody body, com.squareup.okhttp.Response rawResponse)
public com.squareup.okhttp.Response raw()
public int code()
public String message()
public com.squareup.okhttp.Headers headers()
public boolean isSuccess()
true
if code()
is in the range [200..300).public T body()
public com.squareup.okhttp.ResponseBody errorBody()
Copyright © 2015 Square, Inc.. All Rights Reserved.