tlmarker1968

Untitled

Dec 27th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1. This is the code that gets info from the database:
  2.  
  3.     ManagerAdminApi(String strApiUrl) {
  4.         ApiUrl = strApiUrl;
  5.         String BASE_URL = ApiUrl + "admin/";
  6.         HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
  7.         logging.setLevel(HttpLoggingInterceptor.Level.BODY);
  8.         OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
  9.         httpClient.addInterceptor(logging);
  10.         Retrofit retrofit = new Retrofit.Builder()
  11.                 .baseUrl(BASE_URL)
  12.                 .addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
  13.                 .client(httpClient.build())
  14.                 .build();
  15.         service = retrofit.create(InterfaceAdminApi.class);
  16.     }
  17.  
  18. The expected behaviour is that I get information like this:
  19. [
  20.     {
  21.         "id": 1,
  22.         "username": "admin",
  23.         "password": "$2y$10$1h8jP8./G2bvlai3Prgwuu9fHHFsunerV0/aFo.JKKcWPh1MelyHy",
  24.         "created": "2018-04-15T11:53:28-05:00",
  25.         "midified": "2018-04-15T11:53:28-05:00",
  26.         "grade": 4,
  27.         "department": 5
  28.     }
  29. ]
  30.  
  31. It is currently returning a null value for each item
Advertisement
Add Comment
Please, Sign In to add comment