URLConnection getDoOutput Example

Started by VelMurugan, Dec 20, 2008, 09:34 PM

Previous topic - Next topic

VelMurugan

URLConnection getDoOutput Example

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

URLConnection class getDoOutput example. public boolean getDoOutput() Returns the value of this URLConnection's doOutput flag.

Here is the code

/*
* @ # GetDoOutput.java
* A class repersenting use to GetDoOutput
* method of URLConnection class in java.net package
* version 23 June 2008
* author Rose India
*/

import java.net.*;

public class GetDoOutput {

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

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

        URL url = new URL("http://google.com");
        URLConnection connection = url.openConnection(proxy);

        System.out.println("DoOutput " +
                connection.getDoOutput());
    }
}


Output

DoOutput false

Source : codingdiary