1
我在使用robospice中的spring android。我需要放置获取请求标题,所以我使用了exchange()方法。该代码有没有错误,但没有任何获取Robospice loadDataFromNetwork()不工作
public MList loadDataFromNetwork() throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.add(key,keyValue);
HttpEntity entity = new HttpEntity(headers);
ResponseEntity<MList> response=getRestTemplate().exchange(url,HttpMethod.GET,entity,MList.class);
return getRestTemplate().exchange(url, HttpMethod.GET,new HttpEntity<Object> (headers),MList.class).getBody();
}
那你尝试调试时?该方法甚至被称为? – Snicolas 2014-11-01 12:17:09