In my Android application I use escapeJson on the strings (which are created by the user) I upload to my server using StringRequest. If the strings contain a new line then the string on the server contains \

instead of

at each new line.

StringRequest postRequest = new StringRequest(Request.Method.POST, myUrl, new Response.Listener(){ @Override public void onResponse(Object response) { ... } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { ... } } ){ @Override protected Map<String, String> getParams() { Map<String, String> params = new HashMap<String, String>(); params.put("text", StringEscapeUtils.escapeJson(text)); return params; } };