Java HttpURLConnection HTTP_MULT_CHOICE

Syntax

HttpURLConnection.HTTP_MULT_CHOICE has the following syntax.

public static final int HTTP_MULT_CHOICE

Example

In the following code shows how to use HttpURLConnection.HTTP_MULT_CHOICE field.


import java.net.HttpURLConnection;
import java.net.URL;
/*w ww  .  jav  a  2 s .  c o  m*/
public class Main {
  public static void main(String[] argv) throws Exception {
    HttpURLConnection.setFollowRedirects(false);
    HttpURLConnection con = (HttpURLConnection) new URL("http://www.google.coom").openConnection();
    con.setRequestMethod("HEAD");
    System.out.println(con.getResponseCode() == HttpURLConnection.HTTP_MULT_CHOICE);
  }
}




















Home »
  Java Tutorial »
    java.net »




CookieManager
CookiePolicy
CookieStore
DatagramPacket
DatagramSocket
HttpCookie
HttpURLConnection
InetAddress
JarURLConnection
MulticastSocket
ServerSocket
Socket
SocketAddress
URI
URL
URLConnection
URLDecoder
URLEncoder