Code example for StringEntity

Methods: setContentType

0
 
		HttpDeleteWithBody delete = new HttpDeleteWithBody(url);
 
		StringEntity se;
		try { 
			se = new StringEntity(body, HTTP.UTF_8);
			se.setContentType("application/json");
			delete.setEntity(se); 
			response = client.execute(delete);
		}catch (Exception e) {
			Log.e(TAG, e.getMessage());
		} 
		return response;
 
	} 
 
	public boolean deleteCategory(int id)
	{ 
		boolean isDeletedSuccessfully = false;
		try { 
			String url = ApiConnection.mainUrl+"delete_category.json"+"?auth_token="+Session.getInstance().getAuthToken();;