Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @POST("/Auth/authenticate")
- Call<ApiResponse> createAccount(@Body Request user);
- request = new Request("01532383497", "123");
- retrofit = RetrofitInstance.getInstance();
- client = retrofit.create(APIClient.class);
- client.createAccount(request).enqueue(new Callback<ApiResponse>() {
- @Override
- public void onResponse(Call<ApiResponse> call, Response<ApiResponse> response) {
- String a=response.body().getType();
- Log.d("d","d");
- }
- @Override
- public void onFailure(Call<ApiResponse> call, Throwable t) {
- Log.d("d","d");
- }
- });
- String Username;
- String Password;
- public Request(String Username, String Password) {
- Username = Username;
- Password = Password;
- }
- public String getUsername() {
- return Username;
- }
- public void setUsername(String username) {
- Username = username;
- }
- public String getPassword() {
- return Password;
- }
- public void setPassword(String password) {
- Password = password;
- }
- public class RetrofitInstance {
- public static Retrofit retrofit = null;
- public static final String END_POINT = "http://192.168.0.104:50111/api/";
- public static Retrofit getInstance(){
- if (retrofit == null){
- retrofit = new Retrofit.Builder().baseUrl(END_POINT)
- .addConverterFactory(GsonConverterFactory.create())
- .build();
- }
- return retrofit;
- }
Add Comment
Please, Sign In to add comment