Send json data in url as request parameters in java

Total Post:46

Points:324
 1511  View(s)
Ratings:
Rate this:

I want to send json data in url as below .

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

How can I do this?

  1. Post:29

    Points:107
    Re: Send json data in url as request parameters in java

    URL encode your details parameter: 

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

      Modified On Apr-06-2018 05:51:33 AM

Answer