RestTemplate URL Not enough variable values available to expand

4.3k Views Asked by At

I need to pass 2 parameters to the REST URL. Like this:

http://localhost:8080/test/rest/userName/id

I'm trying something like this which obviously is not correct. Please help:

restTemplate.getForObject(localUrl+"{userName}"+"/"+"{id}", Details.class);

EDIT:

I tired this too but same error:

String param = "{userName}/{id}";
restTemplate.getForObject(localUrl+param, Details.class);

Thanks

Harish

0

There are 0 best solutions below