android - Volley gives a Protocol Exception error, 21 too many followups -
this function call:
public static void senddata(final integer type , final string url, final context context, final crudstatecallback back){ stringrequest jr = new stringrequest(type, url, new response.listener<string>() { @override public void onresponse(string response) { system.out.println(response.substring(0,100)); log.i("","wscalls response is: " + response); if(back != null) back.onresponse(200, response); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { log.i("","wscalls went wrong!"); error.printstacktrace(); string errors = "error null"; int code = 0; try { if (error != null) { errors = error.getmessage(); code = error.networkresponse.statuscode; } }catch (exception e){ log.e("","wscalls error in send data:" + e.getmessage()); } if(back != null) back.onresponse(code, errors); } }); if (utils.networkisavailable( context)) { jr.setretrypolicy(new defaultretrypolicy(60 * 1000, 0, 1)); vidyosampleapplication.mrequestqueue.add(jr); } }
with following params:
wscalls.senddata(request.method.get, "https://control.facetalk.nl/vidyologs/call_start.php?meetingid=82000005715&profielid=51108581", vidyosampleactivity.this, null);
i tried url: https://control.facetalk.nl/vidyologs/call_start.php?meetingid=82000005715&profielid=51108581 , works, "200" on postman. volley return following error:
11-17 16:54:57.094: w/system.err(3415): com.android.volley.noconnectionerror: java.net.protocolexception: many follow-up requests: 21 11-17 16:54:57.094: w/system.err(3415): @ com.android.volley.toolbox.basicnetwork.performrequest(basicnetwork.java:151) 11-17 16:54:57.094: w/system.err(3415): @ com.android.volley.networkdispatcher.run(networkdispatcher.java:112) 11-17 16:54:57.094: w/system.err(3415): @ com.android.okhttp.internal.huc.httpurlconnectionimpl.getresponse(httpurlconnectionimpl.java:401) 11-17 16:54:57.094: w/system.err(3415): @ com.android.okhttp.internal.huc.httpurlconnectionimpl.getresponsecode(httpurlconnectionimpl.java:501) 11-17 16:54:57.094: w/system.err(3415): @ com.android.okhttp.internal.huc.delegatinghttpsurlconnection.getresponsecode(delegatinghttpsurlconnection.java:105) 11-17 16:54:57.094: w/system.err(3415): @ com.android.okhttp.internal.huc.httpsurlconnectionimpl.getresponsecode(httpsurlconnectionimpl.java) 11-17 16:54:57.095: w/system.err(3415): @ com.android.volley.toolbox.hurlstack.performrequest(hurlstack.java:110) 11-17 16:54:57.095: w/system.err(3415): @ com.android.volley.toolbox.basicnetwork.performrequest(basicnetwork.java:96)
what can fix this? don't understand, tried modifying detaulf retry policy nothing helps
i did using httpclient instead of volley , worked:
httpclient httpclient = new defaulthttpclient(); httpclient.getparams().setparameter(clientpnames.allow_circular_redirects, true); httppost httppost = new httppost(url); httpresponse response = httpclient.execute(httppost); string responsebody = ""; bufferedreader buffer = new bufferedreader(new inputstreamreader(response.getentity().getcontent())); string s = ""; while ((s = buffer.readline()) != null) responsebody += s; log.i("","wscalls response body is:" + responsebody);
Comments
Post a Comment