title: Passing parameters in Volley JSONArray Request
body: <p>I am trying to get posts from server based on a parameter i.e. email address. How do I send parameters in JSONArrayRequest so that only those posts are retrieved which are matched with the given parameter? Here is my code:
  <strong>JsonArrayRequest:</strong></p>
  
  <pre><code>        JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(url, new Response.Listener&lt;JSONArray&gt;() {
          @Override
          public void onResponse(JSONArray response) {
              for(int i= 0; i&lt;response.length(); i++){
                  try {
                      JSONObject object = response.getJSONObject(i);
                      Post post = new Post();
  
                      post.setContent(object.getString("Content"));
                      post.setDate(object.getString("PostDate"));
                      post.setTime(object.getString("PostTime"));
  
                      postArray.add(post);
                      PostList.notifyDataSetChanged();
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
  
          }
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
  
          }
      });
  
      AppController.getmInstance().addToRequestQueue(jsonArrayRequest);
  </code></pre>
  
  <p>And this is the <strong>AppController.Java</strong> class:</p>
  
  <pre><code>public class AppController extends Application {
  private RequestQueue mRequestQueue;
  private ImageLoader mImageLoader;
  private static AppController mInstance;
  public static final String TAG = AppController.class.getSimpleName();
  
  @Override
  public void onCreate() {
      super.onCreate();
      mInstance = this;
  }
  
  public static synchronized AppController getmInstance() {
      return mInstance;
  }
  
  public RequestQueue getmRequestQueue()
  {
      if(mRequestQueue == null){
          mRequestQueue = Volley.newRequestQueue(getApplicationContext());
      }
      return mRequestQueue;
  }
  public ImageLoader getmImageLoader(){
      getmRequestQueue();
      if(mImageLoader == null){
          mImageLoader = new ImageLoader(this.mRequestQueue, new BitmapCache());
      }
      return mImageLoader;
  }
  
  public &lt;T&gt; void addToRequestQueue(Request&lt;T&gt; request, String tag ){
      request.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
      getmRequestQueue(). add(request);
  
  }
  
  public &lt;T&gt; void addToRequestQueue(Request&lt;T&gt; request ){
      request.setTag(TAG);
      getmRequestQueue(). add(request);
  
  }
  
  public void cancelPendingRequest(Object tag){
      if(mRequestQueue != null){
          mRequestQueue.cancelAll(tag);
      }
  }
  </code></pre>
  
  <p>}</p>