android - How to pass HttpPost( URI ) with Volley Request ? -
how pass httppost( uri ) stringrequest using volley ? need pass uri, request, ,
httppost localhttppost = new httppost(" uri ");
how using volley request ?
well, first of need requestqueue.
requestqueue = volley.newrequestqueue(context);
then, having requestqueue defined in place on code (a global variable) work defining request. example stringrequest. notice method.post in code.
stringrequest req = new stringrequest(method.post, getbaseurl() + post_opportunities_url, requestlistener, new response.errorlistener(){ @override public void onerrorresponse(volleyerror volleyerror) { //manage error } });
and add request de queue
requestqueue.add(req);
Comments
Post a Comment