Guest User

Untitled

a guest
Jun 24th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. D/OkHttp: <-- HTTP FAILED: java.net.UnknownHostException: Unable to resolve host "xyz.aaa.net": No address associated with hostname
  2.  
  3. Call<Response> call2 = apiInterface.getEmployeeListNew("1190",1008,"true"
  4. );
  5. call2.enqueue(new Callback<Response>() {
  6. @Override
  7. public void onResponse(Call<TaxProResponse> call, Response<Response> response) { }
  8.  
  9. @Override
  10. public void onFailure(Call<TaxProResponse> call, Throwable t) {
  11. call.cancel();
  12. }
  13. });
  14.  
  15. class APIClient {
  16.  
  17. private static Retrofit retrofit = null;
  18.  
  19. static Retrofit getClient() {
  20.  
  21. HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
  22. interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
  23. OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
  24.  
  25.  
  26. retrofit = new Retrofit.Builder()
  27. .baseUrl("http://"xyz.aaa.net/api/")
  28. .addConverterFactory(GsonConverterFactory.create())
  29. .client(client)
  30. .build();
  31.  
  32.  
  33.  
  34. return retrofit;
  35. }
  36.  
  37. }
  38.  
  39. @GET("Profile")
  40. Call<Response> getEmployeeListNew(
  41. @Header("app_id") String app_id,
  42. @Query("office_id") int office_id,
  43. @Query("need_only_active") String need_only_active
  44. );
  45.  
  46. http://xyz.aaa.net/api/Profile?office_id=1008&need_only_active=true
Add Comment
Please, Sign In to add comment