HTTP 500 error while sending SMS containing backslash through RESTFUL webservice on OCSG5.0
I am trying to send a message via JSONObject over RESTFUL webservice
1. JSONObject s= new JSONObject();
2. s.put( "addresses" , sno) ;
3. s.put( "message" ,message) ;
4. s.put( "senderName" ,shortcode) ;
5. OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());
6. wr.write( s.toJSONString());
7. wr.flush();
8. // Get the response
9. BufferedReader rd = new BufferedReader( new InputStreamReader(connection.getInputStream()));
Messae is like: String message= “amount1\\KB \n amount2\\KB”
Expected received message: amount1\KB
amount2\KB
Now problem is http server returns me reponse code 500. And cause exception at line 9.
Note: Problem area is String portion \\KB if String would not be containing this back slash everything goes fine.