Code example for HttpDelete

Methods: setHeader

0
        //disableConnectionReuseIfNecessary(); 
 
        try { 
            // Create a new HttpClient and Post Header 
            HttpClient httpclient = new DefaultHttpClient();
            HttpDelete httpDelete = new HttpDelete(serviceUrl + todo.getId());
            httpDelete.setHeader("Content-type", "application/json");
 
            httpclient.execute(httpDelete);            
             
            return true; 
        } catch (Exception e) {
            Log.e("", "Error post JSON-Object in RestService: " + e.getMessage());
        }  
        return false; 
    } 
 
    /** 
     * required in order to prevent issues in earlier Android version. 
      
    private static void disableConnectionReuseIfNecessary() {