How to use the Android Apache HttpDelete class with parameter
android, java
Solution
HTTP DELETE requests do not have a body. You pass parameters right on the URL:
String url = "http://foo.com/bar?bing=bang"
HttpDelete httpdelete = new HttpDelete(url);
Problem
I need to send an ID to the server and have the server to delete one record in a DB. I want to use the HttpDelete Apache Android SDK integrated class but I cannot figure out how to use it and how to pass parameters to the server. With the POST request I use .setEntity method on the HttpPost class. But in HttpDelete there's no .setEntity method. What I have so far achieved is: ``` HttpClient httpclient = new DefaultHttpClient(); HttpDelete httpdelete = new HttpDelete(url); httpdelete.setHeader(HTTP.CONTENT_TYPE, "text/xml"); response = httpclient.execute(httpdelete); ```