URLConnection setDoInput Example

URLConnection class setDoInput example. This example shows you how to use setDoInput method.


URLConnection class setDoInput example. public void setDoInput(boolean doinput) Sets the value of the doInput field for this URLConnection to the specified value.

Here is the code
/*
 * @ # SetDoInput.java
 * A class repersenting use to SetDoInput method 
 * of URL class in java.net package
 * version 24 June 2008
 * author Rose India 
 */

import java.net.*;

public class SetDoInput {

    public static void main(String args[]) throws Exception {

        SocketAddress address = new InetSocketAddress("192.168.10.80"9090);
        Proxy proxy = new Proxy(Proxy.Type.HTTP, address);

        URL url = new URL("http://google.com");
        URLConnection connection = url.openConnection(proxy);
        System.out.println("doInput " + connection.getDoInput());
        connection.setDoInput(false);
        System.out.println("doInput " + connection.getDoInput());
    }
}

Output
doInput true
doInput false

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US