标签:turn amp class get string login lag pass param
String url = serverUrl+"/path/path?id={id}"; int i = restTemplate.getForObject(url,int.class,id);
URI url= UriComponentsBuilder.fromUriString(serverUrl) .path("/path/") .queryParam("key", key) .queryParam("key2",key2) .queryParam("key3",key3) .build() .toUri(); return restTemplate.getForObject(url,String.class);
数据以键值对的方式进行传输,如:K=V&K=V
MultiValueMap<String,Object> map = new LinkedMultiValueMap<>(); map.add("userid",userid); map.add("password",password); boolean flag = restTemplate.postForObject(loginUrl,map,boolean.class);
标签:turn amp class get string login lag pass param
原文地址:http://www.cnblogs.com/yanqin/p/7170496.html