title: Volley error: Unexpected response code 400
body: <p>I use below code to get Volley request and get json:</p>
  
  <pre><code>  JsonObjectRequest jsonReq = new JsonObjectRequest(Request.Method.POST,
                  service_address , null, new Response.Listener&lt;JSONObject&gt;() {
  
              @Override
              public void onResponse(JSONObject response) {
                  VolleyLog.d(TAG, "Response: " + response.toString());
                  if (response != null) {
                      parseJsonFeed(response);
                  }
              }
          }, new Response.ErrorListener() {
  
              @Override
              public void onErrorResponse(VolleyError error) {
                  VolleyLog.d(TAG, "Error: " + error.getMessage());
              }
          }){
  
  
              @Override
              protected Map&lt;String,String&gt; getParams(){
                  Map&lt;String,String&gt; params = new HashMap&lt;String, String&gt;();
                  params.put("username", username);
                  params.put("password", password);
  
                  return params;
              }
  
              @Override
              public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
                  Map&lt;String,String&gt; params = new HashMap&lt;String, String&gt;();
                  // Removed this line if you dont need it or Use application/json
                  // params.put("Content-Type", "application/x-www-form-urlencoded");
                  return params;
              }
          };
  </code></pre>
  
  <p>but after running it gives me this error in <code>logcat</code>:</p>
  
  <pre><code>BasicNetwork.performRequest: Unexpected response code 400
  </code></pre>
  
  <p>I read <a href="https://stackoverflow.com/questions/26796965/android-volley-basicnetwork-performrequest-unexpected-response-code-400">this link</a>, but it will not help me. I'm so confused whats wrong with my code?</p>