标签:对象 geturl ott map pos round logs padding user
1.postForObject :传入一个业务对象,返回是一个String
调用方:
BaseUser baseUser=new BaseUser(); baseUser.setUserid(userid); baseUser.setPass(pass); String postForObject = restTemplate.postForObject(this.getURL()+"/user/login", baseUser, String.class); return postForObject;
接收方:
public String login(@RequestBody BaseUser baseUser) {}
1.postForObject :传入一个Map,返回是一个String
调用方:
MultiValueMap<String, String> postParameters = new LinkedMultiValueMap<String, String>(); postParameters.add("userid", userid); postParameters.add("pass", pass); String postForObject = restTemplate.postForObject(this.getURL()+"/user/login", postParameters,String.class); return postForObject;
接收方:
public String login(@RequestParam String userid, @RequestParam String pass) {}
标签:对象 geturl ott map pos round logs padding user
原文地址:http://www.cnblogs.com/huiy/p/7162285.html