title: How to solve error : null in volley library?
body: <p>In my project, I am using the volley library to get data(text and image) from the server and show the data in RecyclerView. The problem is all the requests (POST) I am sending give no response and error: null(error.getMessage() is null). I have searched about it for two days but was unable to find any solution.</p>
  <p>This is my volley singleton class :</p>
  <pre><code>import android.app.Application;
  import android.text.TextUtils;
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.toolbox.ImageLoader;
  import com.android.volley.toolbox.Volley;
  
  public class HttpController extends Application {
  
  public static final String TAG = HttpController.class
          .getSimpleName();
  
  private RequestQueue mRequestQueue;
  private ImageLoader mImageLoader;
  
  private static HttpController mInstance;
  
  @Override
  public void onCreate() {
      super.onCreate();
      mInstance = this;
  }
  
  public static synchronized HttpController getInstance() {
      return mInstance;
  }
  
  public RequestQueue getRequestQueue() {
      if (mRequestQueue == null) {
          mRequestQueue = Volley.newRequestQueue(getApplicationContext());
      }
      return mRequestQueue;
  }
  
  public ImageLoader getImageLoader() {
      getRequestQueue();
      if (mImageLoader == null) {
          mImageLoader = new ImageLoader(this.mRequestQueue,
                  new LruBitmapCache());
      }
      return this.mImageLoader;
  }
  
  public &lt;T&gt; void addToRequestQueue(Request&lt;T&gt; req, String tag) {
      // set the default tag if tag is empty
      req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
      getRequestQueue().add(req);
  }
  
  public &lt;T&gt; void addToRequestQueue(Request&lt;T&gt; req) {
      req.setTag(TAG);
      getRequestQueue().add(req);
  }
  
  public void cancelPendingRequests(Object tag) {
      if (mRequestQueue != null) {
          mRequestQueue.cancelAll(tag);
      }
  }
  
  }
  </code></pre>
  <p>I am using this code to send request :</p>
  <pre><code>StringRequest data = new StringRequest(Request.Method.POST,
                  &quot;http://odishasamaya.com/news/api/get_category_posts/&quot;, new Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String response) {
                  Log.d(TAG, &quot;News request Response : &quot; + response);
                  try {
                      JSONObject jsonObject = new JSONObject(response);
                      if (jsonObject.getString(&quot;status&quot;).equalsIgnoreCase(&quot;ok&quot;))
                          adapter.setNewsList(getNewsData(jsonObject.getJSONArray(&quot;posts&quot;), progressBar, news));
  
                      else
                          Log.e(&quot;tabs name&quot;, &quot;array is null&quot;);
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  Log.e(TAG, &quot;Request Error: &quot; + error.getMessage());
                  Toast.makeText(getActivity(),
                          error.getMessage(), Toast.LENGTH_LONG).show();
              }
          }) {
              @Override
              protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
  
                  Map&lt;String, String&gt; params = new HashMap&lt;&gt;();
  
                  params.put(&quot;id&quot;, id.get(getArguments().getInt(&quot;position&quot;)));
                  Log.d(&quot;params are :&quot;, &quot;&quot; + params);
  
                  return params;
  
              }
          };
          //HttpController.getInstance().cancelPendingRequests(tag_json_req);
          HttpController.getInstance().addToRequestQueue(data, tag_json_req);
  </code></pre>
  <p>I am unable to find what is the problem. Please help me with this or if there is any other library that I can use for HTTP requests please let me know. I need to finish this as soon as possible. Thanks in advance.</p>