Send json data in url as request parameters in java

I want to send json data in url as below .

editTest.jsp?details=123456789-{"aNumber":2}

How can I do this?

Last updated:11/13/2014 12:19:17 AM

1 Answers

Anonymous User
Anonymous User

URL encode your details parameter: 

String otherParameter = "123456789-";    
String jsonString = "{\"aNumber\":2}";
String url = "editTest.jsp?details=" + URLEncoder.encode(otherParameter + jsonString, "UTF-8");

Answer