android - Volley - POST/GET parameters -


i saw google io 2013 session volley , i'm considering switching volley. volley support adding post/get parameters request? if yes, how can it?

in request class (that extends request), override getparams() method. same headers, override getheaders().

if @ postwithbody class in testrequest.java in volley tests, you'll find example. goes this

public class loginrequest extends request<string> {      // ... other methods go here      private map<string, string> mparams;      public loginrequest(string param1, string param2, listener<string> listener, errorlistener errorlistener) {         super(method.post, "http://test.url", errorlistener);         mlistener = listener;         mparams = new hashmap<string, string>();         mparams.put("paramone", param1);         mparams.put("paramtwo", param2);      }      @override     public map<string, string> getparams() {         return mparams;     } } 

evan charlton kind enough make quick example project show how use volley. https://github.com/evancharlton/folly/


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -