我尝试使用弹簧RestTemplate.getForObject()访问休息端点,但我的uri变量未展开,并作为参数附加到url.这是我到目前为止所得到的:
MapuriParams = new HashMap (); uriParams.put("method", "login"); uriParams.put("input_type", DATA_TYPE); uriParams.put("response_type", DATA_TYPE); uriParams.put("rest_data", rest_data.toString()); String responseString = template.getForObject(endpointUrl, String.class, uriParams);
endpointUrl变量的值是,http://127.0.0.1/service/v4_1/rest.php
并且它的确是它所谓的,但我希望http://127.0.0.1/service/v4_1/rest.php?method=login&input_type...
被调用.任何提示都表示赞赏.
我正在使用Spring 3.1.4.RELEASE
问候.