Hi again! Pls some one help me to find out what is the problem with this code....
import java.io.*;
import java.net.*;
public class NewClass2
{
public static void main (String args[])
{
try
{
// Construct data
// Send data
String data="Something";
URL url = new URL("http://www.google.co.uk/");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
// Get the response
BufferedReader in = new BufferedReader (new InputStreamReader(conn.getInputStream ()));
String temp,response="";
while ((temp = in.readLine()) != null){
response += temp + "\n";
}
temp = null;
System.out.println("Server response:\n'" + response + "'");
wr.close();
in.close();
}
catch (Exception e)
{
}
}
}
.....
So the build was successful but didn't get anything back from the
while ((temp = in.readLine()) != null){
response += temp + "\n";
}