Spring mvc SpringMVC-如何在请求映射中传递HashMap
我正在使用SpringMVC和RESTFullWebService 来自我的客户机程序的代码片段Spring mvc SpringMVC-如何在请求映射中传递HashMap,spring-mvc,Spring Mvc,我正在使用SpringMVC和RESTFullWebService 来自我的客户机程序的代码片段 RestTemplate restTemplate = new RestTemplate(); String startProcessURL = "http://"+hostAddress+":"+portNumber+"/jBPMSpring/process/startProcess/"+processId 当我使用RequestMapping.GET方法时,上面的代码运行良好 在我的客户端程
RestTemplate restTemplate = new RestTemplate();
String startProcessURL = "http://"+hostAddress+":"+portNumber+"/jBPMSpring/process/startProcess/"+processId
当我使用RequestMapping.GET方法时,上面的代码运行良好
在我的客户端程序中,我需要在请求映射(POST)中传递HashMap
有什么变化,我需要通过HashMap。有两个选项,postForLocation或 初始化后,您可以将hashmap包装到一个类中:
String result = rest.postForObject("http://whatever.com/whenever/", yourClass, String.class,);