Hi i have written a rest service to delete multiple files and i am trying to access the rest service. My input to rest service will be List values which will be id of files that needs to be deleted. For that i have written the below code
List<Long> ids=new ArrayList<Long>();
ids.add(4l);
ids.add(5l);
boolean status = false;
String jsonResponse = null;
DefaultHttpClient httpClient = null;
HttpResponse response = null;
try {
httpClient = new DefaultHttpClient();
StringBuilder url = new StringBuilder("http://localhost:8080/api/files");
URIBuilder builder = new URIBuilder();
URI uri = builder.build();
HttpDelete deleteRequest = new HttpDelete(uri);
//how to set list as Requestbody and send
response = httpClient.execute(deleteRequest);
}
Here i dont know how to set List as entity in request body and send. Can someone help me on this