Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- D/OkHttp: <-- HTTP FAILED: java.net.UnknownHostException: Unable to resolve host "xyz.aaa.net": No address associated with hostname
- Call<Response> call2 = apiInterface.getEmployeeListNew("1190",1008,"true"
- );
- call2.enqueue(new Callback<Response>() {
- @Override
- public void onResponse(Call<TaxProResponse> call, Response<Response> response) { }
- @Override
- public void onFailure(Call<TaxProResponse> call, Throwable t) {
- call.cancel();
- }
- });
- class APIClient {
- private static Retrofit retrofit = null;
- static Retrofit getClient() {
- HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
- interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
- OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
- retrofit = new Retrofit.Builder()
- .baseUrl("http://"xyz.aaa.net/api/")
- .addConverterFactory(GsonConverterFactory.create())
- .client(client)
- .build();
- return retrofit;
- }
- }
- @GET("Profile")
- Call<Response> getEmployeeListNew(
- @Header("app_id") String app_id,
- @Query("office_id") int office_id,
- @Query("need_only_active") String need_only_active
- );
- http://xyz.aaa.net/api/Profile?office_id=1008&need_only_active=true
Add Comment
Please, Sign In to add comment