title: Delete Request With header and Parametes Volley
body: <p>Hi i want to Send Delete Request to server using Volley along Headers and body parameters. but i am not able to send request successfully</p>
  
  <p><strong>What i have tried</strong></p>
  
  <pre><code>JSONObject jsonbObjj = new JSONObject();
  try {
      jsonbObjj.put("nombre", Integer.parseInt(no_of_addition
              .getText().toString()));
      jsonbObjj.put("cru", crue);
      jsonbObjj.put("annee", 2010);
  } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  VolleyRequest mVolleyRequest = new VolleyRequest(
          Method.DELETE, url, jsonbObjj,
  
          new Listener&lt;JSONObject&gt;() {
  
              @Override
              public void onResponse(JSONObject jsonObject) {
                  // TODO Auto-generated method stub
  
                  if (pDialog != null) {
                      pDialog.dismiss();
                  }
                  Log.e("Server Response", "response = "
                          + jsonObject.toString());
              }
  
          }, new ErrorListener() {
  
              @Override
              public void onErrorResponse(VolleyError arg0) {
                  // TODO Auto-generated method stub
                  if (pDialog != null) {
                      pDialog.dismiss();
                  }
                  Log.e("Error Response",
                          "Error " + arg0.getMessage());
                  Log.e("Error Response",
                          "Error = " + arg0.getCause());
  
              }
          }, mUserSession.getUserEmail(), mUserSession
                  .getUserPassword(), false);
  
  ApplicationController.getInstance().addToRequestQueue(
          mVolleyRequest, "deleteRequest");
  </code></pre>
  
  <p>and here is my VolleyRequest request class</p>
  
  <pre><code>public class VolleyRequest extends JsonObjectRequest {
  
      String email, pass;
      boolean saveCookeis;
  
      public VolleyRequest(int method, String url, JSONObject jsonRequest,
              Listener&lt;JSONObject&gt; listener, ErrorListener errorListener,
              String email, String pass, boolean saveCookie) {
          super(method, url, jsonRequest, listener, errorListener);
          // TODO Auto-generated constructor stub
          this.email = email;
          this.pass = pass;
          this.saveCookeis = saveCookie;
      }
  
      public VolleyRequest(int method, String url, JSONObject jsonRequest,
              Listener&lt;JSONObject&gt; listener, ErrorListener errorListener) {
          super(Method.POST, url, jsonRequest, listener, errorListener);
          // TODO Auto-generated constructor stub
  
      }
  
      @Override
      public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
          // TODO Auto-generated method stub
              HashMap&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
  
              String auth = "";
              try {
                  auth = android.util.Base64.encodeToString(
                          (this.email + ":" + this.pass).getBytes("UTF-8"),
                          android.util.Base64.DEFAULT);
              } catch (UnsupportedEncodingException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
              params.put("Authorization", auth);
              return params;
      }
  
      @Override
      protected Response&lt;JSONObject&gt; parseNetworkResponse(NetworkResponse response) {
          // TODO Auto-generated method stub
  
          if (saveCookeis) {
              try {
                  String jsonString = new String(response.data,
                          HttpHeaderParser.parseCharset(response.headers));
  
                  ApplicationController.getInstance().checkSessionCookie(
                          response.headers);
  
                  return Response.success(new JSONObject(jsonString),
                          HttpHeaderParser.parseCacheHeaders(response));
  
              } catch (UnsupportedEncodingException e) {
                  return Response.error(new ParseError(e));
              } catch (JSONException je) {
                  return Response.error(new ParseError(je));
              }
          }
          return super.parseNetworkResponse(response);
  
      }
  
  }
  </code></pre>
  
  <p>When i tried this code i get 400 response code error Please let me know if anyone can help me.. that what i am doing wrong. Thanks</p>
  
  <p>here the screen shots for Delete Api which i tested and its working fine.</p>
  
  <p><a href="https://i.stack.imgur.com/fwSqV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fwSqV.png" alt="I need to send this Data to server"></a></p>
  
  <p><a href="https://i.stack.imgur.com/X7vV5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/X7vV5.png" alt="And here is the response form server"></a></p>