Hi,
I am not able to get the url request using httpunit. But i am able to get request from local host, what could be the problem. the code is shown below.
/** This is a simple example of using HttpUnit to read web pages. **/
public class Test1 {
public static void main( String[] params ) {
try {
WebConversation wc = new WebConversation();
WebRequest req = new GetMethodWebRequest( "http://netbeans.org" );
WebResponse resp = wc.getResponse( req );
Hi,
I am not able to get the url request using httpunit. But i am able to get request from local host, what could be the problem. the code is shown below.
import com.meterware.httpunit.*;
import java.io.*;
/** This is a simple example of using HttpUnit to read web pages. **/
public class Test1 {
public static void main( String[] params ) {
try {
WebConversation wc = new WebConversation();
WebRequest req = new GetMethodWebRequest( "http://netbeans.org" );
WebResponse resp = wc.getResponse( req );
}catch (java.net.MalformedURLException e) {
System.out.println("Bad url: " + e);
}
catch (IOException e) {
System.out.println("IO Err: " + e);
}
catch (org.xml.sax.SAXException e) {
System.out.println("XML Err: " + e);
}
}
}
on runnning this code i am getting java.io.IOException. How can i resolve it.
Thanks and regards,
Arun.