Here you can find the source of retrieveHtml(URLConnection http)
Parameter | Description |
---|---|
http | Description of the Parameter |
Parameter | Description |
---|
public static String retrieveHtml(URLConnection http) throws java.io.IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URLConnection; public class Main { /**/*from ww w. j a v a 2s . c o m*/ * Returns the text received from a web post * * @param http Description of the Parameter * @return Description of the Return Value * @throws java.io.IOException Description of the Exception */ public static String retrieveHtml(URLConnection http) throws java.io.IOException { StringBuffer htmlOutput = new StringBuffer(); InputStreamReader input = new InputStreamReader(http.getInputStream()); BufferedReader inStream = new BufferedReader(input); String inputLine; while ((inputLine = inStream.readLine()) != null) { htmlOutput.append(inputLine + System.getProperty("line.separator")); } inStream.close(); return htmlOutput.toString(); } }