0

Here's my URL that I need to feed in to RESTTemplate.

http://myurl.com/items?select=itemCode,itemType,code&criteria={"uniquecriteriaId":"2055"}

I need to replace 2055 with whatever the User sends in. The problem is that I'm not able to properly encode the URL as it has those flower brackets, intentional double quotes. How can I construct this URL for properly inputting it to the RestTemplate. Let's say that the user sent value for the "2055" above is stored in

String id="2055";

My RestTemplate query looks something like this

rt.getForEntity(url, List.class);
user6123723
  • 10,546
  • 18
  • 67
  • 109
  • Or see [here](http://stackoverflow.com/questions/27537766/illegalargumentexception-not-enough-variable-values-available-with-resttemplate/27583440#27583440). – Sotirios Delimanolis Dec 21 '16 at 17:14
  • @SotiriosDelimanolis Please remove the duplicate label. I followed the instructions in that thread and the solution doesn't work. See the response I posted to David's comment. Thank you. – user6123723 Dec 21 '16 at 18:38
  • That's an unrelated problem. See [here](http://stackoverflow.com/questions/25642104/java-lang-illegalargumentexception-protocol-http-host-null) for example or ask a new question with a [mcve]. – Sotirios Delimanolis Dec 21 '16 at 18:58

0 Answers0