Code example for HttpURLConnection

Methods: setDoOutput, setRequestMethod

0
	} 
 
	public int executeMethod() throws IOException{  
            URL url = new URL(uri);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setDoOutput(false);
            connection.setRequestMethod("GET");
 
            this.response = new Response(connection);
            return response.getCode();
 
	} 
 
	private String getFullUri() {
		return uri;
	} 
 
	public String getResponseBodyAsString() throws IOException{ 
		 return response.getContent();
	}