Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Owner and Founder. Opencart
Top Partners
Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster. But as being new its quiet confusing for most of us.
One of the confusion is setting parameters in volley requests. The paramenters can be set in a volley request by overriding getParams() method of Request<T> class. But the problem is that the getParams() is called only in the case of POST or PUT request. As the documentation says:
But what in case of GET method!!
In case of GET method the paraments are concatenated with the url and then url is passed.
Its quiet easier approach but it becomes a lot of work when you have a lot of parameters then you have to concatenate each and every paramenter in the url. In GET request the getParams() is not even called so there is no way you can use the methods
In case of POST method you can override the getParams() and give all the parameters you want over there.
Also for JSONobjectRequest the getParams() doen’t even work for POST request so you have to make a customRequest and override getParams() method over there. Its because JsonObjectRequest is extended JsonRequest which override getBody() method directly, so your getParam() would never invoke. To invoke your getParams() method you first have to override getBody(). Or for a simple solution you can use StringRequest.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
We've bought a Shopware Extension which is a hybrid App, which we can now offer in the Google Play Store and the IOS App Store. I'am still impressed how fast and how sharp the support team leads us through every process of the App-Store clarification. Very fast and useful response.
Markus Walter
Founder, Das Apartment Living
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.