public static String getResponse(HttpURLConnection request)throws Exception
	{
		
		int status = request.getResponseCode();
		
		String line = "";
		String responseLine = "";
		
		BufferedReader br;
	
		if(status == 200 || status == 201)
		{
			br = new BufferedReader(new InputStreamReader(request.getInputStream()));
	
			while ((line = br.readLine()) != null) 
			{
				responseLine += line;
			}
	
			String resp = responseLine;
		
			return resp;
		}
		
		if(status == 204)
		{
			throw new ProjectsException(status, "No content for the requested resource."); //No I18N
		}
		
		else
		{
			br = new BufferedReader(new InputStreamReader(request.getErrorStream()));
		
			while ((line = br.readLine()) != null) 
			{
				responseLine += line;
			}
			
			JSONObject resp = new JSONObject(responseLine.trim());
			
			JSONObject error = resp.getJSONObject("error");
		
			throw new ProjectsException(error.getInt("code"), error.getString("message")); //No I18N
		
		}
		
		
	}