vendredi 23 janvier 2015

Can I pass a set of ids for fetching in a restTemplate GET request?

I have an android app that connects to SQLite db which returns JSON on requests. One of my classes is called User and at one point my session gets a list of User ids. I'm wondering if there's a way to pass all the ids in one GET call and receive a list of the users back. Something like:



case GET:
headers.add("Authorization", "Token token=" +token);
headers.add("params" ListOfIds)
restTemplate.getMessageConverters().add(new MappingJacksonHttpMessageConverter());
postEntity = new HttpEntity<Object>(headers);
response = restTemplate.exchange(Config.WEB_SERVICE_URL + "favorites",HttpMethod.GET,postEntity, UserList.class);
break;

Aucun commentaire:

Enregistrer un commentaire