Code example for HttpDelete

Methods: abort

0
		} 
		return json;
	} 
	public static void delete(HttpClient httpclient, String id) throws ClientProtocolException, IOException, JSONException {
		String rev = DataController.readFromCouchdb(httpclient, id);
		HttpDelete request = new HttpDelete( DB_SERVER + "/" + id + "?" + "rev=" + rev );
	    HttpResponse res = httpclient.execute( request, new BasicHttpContext() ); 
	    validateResponse(res, "delete id " + id);
	    request.abort();
	} 
	 
	public static void deleteAll(HttpClient httpclient) throws ClientProtocolException, IOException, JSONException {
		HttpGet get = new HttpGet(DB_SERVER + "/_all_docs");
		HttpResponse res = httpclient.execute(get);
		JSONObject json = new JSONObject(DataController.readContent(res));
		JSONArray ja = new JSONArray(json.getString("rows"));
		for (int i = 0; i < ja.length(); i++) {
			JSONObject jo = ja.getJSONObject(i);
			String id = jo.getString("id");
			if (!id.startsWith("_design")) {
				DataController.delete(httpclient, id);