title: how NOT to escape slashes, sending POST request using volley
body: <p>I am sending POST request using volley. Request has custom headers and json request body. One of the json values in request body is a URL. When i create a jsonobject the // in URL is sent as \/\/. (e.g. "key1:"http//www.xyz.com" is sent as "key1":"http:\/\/www.xyz.com"
  This causes a 400 error. How do i fix this?</p>
  
  <p>Here is the POST using volley:</p>
  
  <pre><code>RequestQueue queue = Volley.newRequestQueue(this);
  
          try{
              jsonBody = new JSONObject();
              jsonBody.put("Key1","http://xyz1.com");
              jsonBody.put("Key2","val2");
  
          }
          catch (JSONException e){
  
          }
  
  
          JsonObjectRequest req = new JsonObjectRequest(Request.Method.POST,URL, jsonBody,
                  new Response.Listener&lt;JSONObject&gt;() {
                      @Override
                      public void onResponse(JSONObject response) {
                          // handle response
                          Log.d("MAIN","response recd="+response.toString());
                      }
                  }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  // handle error
              }
          }) {
  
  
  
              @Override
              public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
                  HashMap&lt;String, String&gt; headers = new HashMap&lt;String, String&gt;();
                  headers.put("CUSTOM_HEADER", "Yahoo");
                  headers.put("ANOTHER_CUSTOM_HEADER", "Google");
                  return headers;
              }
  
  
          };
  
          queue.add(req);
  </code></pre>