Why do I get Android : The target server failed to respond?

前端 未结 1 637
旧时难觅i
旧时难觅i 2021-01-15 03:57

API Link : http://www.familybuds.com/storegrunt-new/api_home/validate_step_one/platform/1

POST parameter : store_name = \"abc\" the code is

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-15 04:18

    HttpParams httpParameters = new BasicHttpParams();
    HttpConnectionParams.setConnectionTimeout(httpParameters, 10000);
    HttpConnectionParams.setSoTimeout(httpParameters, 10000+12000);
    
    
    DefaultHttpClient  client = new DefaultHttpClient(httpParameters);
    HttpPost httppost = new HttpPost(url);
    

    Try replacing above code with this

    HttpParams httpParameters = new BasicHttpParams();
    HttpConnectionParams.setConnectionTimeout(httpParameters, 10000);
    HttpConnectionParams.setSoTimeout(httpParameters, 10000+12000);
    
    
    DefaultHttpClient  client = new DefaultHttpClient();
    HttpPost httppost = new HttpPost(url);
    httpost.setParams(httpParameters);
    

    This solution worked for me....

    0 讨论(0)
提交回复
热议问题