Created
April 28, 2017 14:26
-
-
Save b00sti/48ca9eece6a2eb5b928936f97e4e0d15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserService apiService = retrofit.create(UserService.class); | |
String username = "b00sti"; | |
Call<User> call = apiService.getUser(username); | |
call.enqueue(new Callback<User>() { | |
@Override | |
public void onResponse(Call<User> call, Response<User> response) { | |
int statusCode = response.code(); | |
User user = response.body(); | |
} | |
@Override | |
public void onFailure(Call<User> call, Throwable t) { | |
// Do something if error occurs | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment