Java URLConnection .getHeaderFieldInt (String name, int Default)

Syntax

URLConnection.getHeaderFieldInt(String name, int Default) has the following syntax.

public int getHeaderFieldInt(String name,   int Default)

Example

In the following code shows how to use URLConnection.getHeaderFieldInt(String name, int Default) method.


import java.net.URL;
import java.net.URLConnection;
/*  www  .  j a v a2 s.c  o m*/
public class Main{
  public static void main(String args[]) throws Exception {
    URL url = new URL("http://www.google.com");
    URLConnection httpCon = (URLConnection) url.openConnection();

    int s = httpCon.getHeaderFieldInt("intKey", 1);


 }
}




















Home »
  Java Tutorial »
    java.net »




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