我正在尝试使用 spring rest 模板来做一个发布请求。我需要返回状态码。这是我的方法。
RestTemplate restTemplate = new RestTemplate();
MultiValueMap mvm = new LinkedMultiValueMap();
mvm.add("login", "100");
// and some more paramters
String result = restTemplate.postForObject("http://localhost:8080/security_check", mvm, String.class);
但是这种方法对我不起作用。它会生成一个错误,提示找不到合适的消息转换器。我需要知道我可以使用 resttemplate 来管理我的会话。我需要从 android 客户端管理会话。
如果有人遇到 android resttemplate post 方法和会话管理,请帮助我。任何帮助将不胜感激。
提前致谢。