用 Spring RestTemplate 请求URL为"http://dffffff/fdsa?queryParam={\"fds\":\"www\"}"时报Not enough variable values availabel异常,其根本原因是RestTemplate认为大括号{…}在给定的URL作为一个URI变量占位符和试图取代他们,
可用queryParam={queryParam}替代
Map<String,Object> params = new HashMap<>();
if(!StringUtils.isEmpty(mobile))
params.put("mobile", mobile);
if(!StringUtils.isEmpty(userName))
params.put("name", userName);
if(!StringUtils.isEmpty(email)){
params.put("email", email);
String queryParam = JSONObject.valueToString(params);
ResponseEntity<PSResponseData> entity = restTemplate.exchange(Constants.PS_WEB_URL + "esb/query/view?serviceCode=2001&consumerCode=10015&queryParam={queryParam}", HttpMethod.GET, null, PSResponseData.class,queryParam);