title: Posting form-data Parameters in the body using Volley
body: <p>This is the Post Request done using postman</p>
  
  <p><a href="https://i.stack.imgur.com/ZtTki.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZtTki.png" alt="enter image description here"></a></p>
  
  <p>The response I want to get is : </p>
  
  <pre><code>    {
    "result": "success",
    "reason": {
      "first_name": "aswath",
      "last_name": "AsH",
      "email": "selviragu09@gmail.com",
      "phone": "\"8867336754\"",
      "authy_id": "26829982",
      "updated_at": "2016-09-27 06:38:07",
      "created_at": "2016-09-27 06:38:07",
      "id": "5012"
    },
    "sms": "token sent"
  }
  </code></pre>
  
  <p>This is the Request I am trying to send : </p>
  
  <pre><code> JSONObject jsonBody = new JSONObject();
          jsonBody.put("first_name", firstname);
          jsonBody.put("last_name", lastName);
          jsonBody.put("email", Email);
          jsonBody.put("phone", number);
  
          final String mRequestBody = jsonBody.toString();
  
          StringRequest stringRequest = new StringRequest(Request.Method.POST, URL, new Response.Listener&lt;String&gt;() {
  
              @Override
              public void onResponse(String response) {
                  Log.i("VOLLEY", response);
                  Log.d("**********", "FETCHING IN VOLLEY REQ" + response.toString());
  
  
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  Log.e("VOLLEY", error.toString());
              }
          }) {
              @Override
              public String getBodyContentType() {
                  return "application/json; charset=utf-8";
              }
  
  
              @Override
              public byte[] getBody() throws AuthFailureError {
                  try {
                      return mRequestBody == null ? null : mRequestBody.getBytes("utf-8");
                  } catch (UnsupportedEncodingException uee) {
                      VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s", mRequestBody, "utf-8");
                      return null;
                  }
              }
  
  
              @Override
              public Map&lt;String, String&gt; getHeaders() throws AuthFailureError
              {
                  Map&lt;String, String&gt; headers = new HashMap&lt;String, String&gt;();
                  headers.put("Content-Type", "multipart/form-data");
                  return headers;
              }
              @Override
              protected Response&lt;String&gt; parseNetworkResponse(NetworkResponse response) {
                  String responseString = "";
                  if (response != null) {
                      responseString = String.valueOf(response.statusCode);
                      // can get more details such as response.headers
                  }
                  return Response.success(responseString, HttpHeaderParser.parseCacheHeaders(response));
              }
          };
  
          getRequestOtpPage().addToRequestQueue(stringRequest);
  </code></pre>
  
  <p>But when i post request it returns the error!</p>
  
  <p>How to solve the problem?</p>