java.net
Class HttpURLConnection

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.net.URLConnection sample code for java.net.URLConnection definition code for java.net.URLConnection 
      extended by java.net.HttpURLConnection

public abstract class HttpURLConnection
extends URLConnection sample code for java.net.URLConnection definition code for java.net.URLConnection

A URLConnection with support for HTTP-specific features. See the spec for details.

Each HttpURLConnection instance is used to make a single request but the underlying network connection to the HTTP server may be transparently shared by other instances. Calling the close() methods on the InputStream or OutputStream of an HttpURLConnection after a request may free network resources associated with this instance but has no effect on any shared persistent connection. Calling the disconnect() method may close the underlying socket if a persistent connection is otherwise idle at that time.

Since:
JDK1.1
See Also:
disconnect() sample code for java.net.HttpURLConnection.disconnect() definition code for java.net.HttpURLConnection.disconnect()

Field Summary
protected  int chunkLength sample code for java.net.HttpURLConnection.chunkLength definition code for java.net.HttpURLConnection.chunkLength
          The chunk-length when using chunked encoding streaming mode for output.
protected  int fixedContentLength sample code for java.net.HttpURLConnection.fixedContentLength definition code for java.net.HttpURLConnection.fixedContentLength
          The fixed content-length when using fixed-length streaming mode.
static int HTTP_ACCEPTED sample code for java.net.HttpURLConnection.HTTP_ACCEPTED definition code for java.net.HttpURLConnection.HTTP_ACCEPTED
          HTTP Status-Code 202: Accepted.
static int HTTP_BAD_GATEWAY sample code for java.net.HttpURLConnection.HTTP_BAD_GATEWAY definition code for java.net.HttpURLConnection.HTTP_BAD_GATEWAY
          HTTP Status-Code 502: Bad Gateway.
static int HTTP_BAD_METHOD sample code for java.net.HttpURLConnection.HTTP_BAD_METHOD definition code for java.net.HttpURLConnection.HTTP_BAD_METHOD
          HTTP Status-Code 405: Method Not Allowed.
static int HTTP_BAD_REQUEST sample code for java.net.HttpURLConnection.HTTP_BAD_REQUEST definition code for java.net.HttpURLConnection.HTTP_BAD_REQUEST
          HTTP Status-Code 400: Bad Request.
static int HTTP_CLIENT_TIMEOUT sample code for java.net.HttpURLConnection.HTTP_CLIENT_TIMEOUT definition code for java.net.HttpURLConnection.HTTP_CLIENT_TIMEOUT
          HTTP Status-Code 408: Request Time-Out.
static int HTTP_CONFLICT sample code for java.net.HttpURLConnection.HTTP_CONFLICT definition code for java.net.HttpURLConnection.HTTP_CONFLICT
          HTTP Status-Code 409: Conflict.
static int HTTP_CREATED sample code for java.net.HttpURLConnection.HTTP_CREATED definition code for java.net.HttpURLConnection.HTTP_CREATED
          HTTP Status-Code 201: Created.
static int HTTP_ENTITY_TOO_LARGE sample code for java.net.HttpURLConnection.HTTP_ENTITY_TOO_LARGE definition code for java.net.HttpURLConnection.HTTP_ENTITY_TOO_LARGE
          HTTP Status-Code 413: Request Entity Too Large.
static int HTTP_FORBIDDEN sample code for java.net.HttpURLConnection.HTTP_FORBIDDEN definition code for java.net.HttpURLConnection.HTTP_FORBIDDEN
          HTTP Status-Code 403: Forbidden.
static int HTTP_GATEWAY_TIMEOUT sample code for java.net.HttpURLConnection.HTTP_GATEWAY_TIMEOUT definition code for java.net.HttpURLConnection.HTTP_GATEWAY_TIMEOUT
          HTTP Status-Code 504: Gateway Timeout.
static int HTTP_GONE sample code for java.net.HttpURLConnection.HTTP_GONE definition code for java.net.HttpURLConnection.HTTP_GONE
          HTTP Status-Code 410: Gone.
static int HTTP_INTERNAL_ERROR sample code for java.net.HttpURLConnection.HTTP_INTERNAL_ERROR definition code for java.net.HttpURLConnection.HTTP_INTERNAL_ERROR
          HTTP Status-Code 500: Internal Server Error.
static int HTTP_LENGTH_REQUIRED sample code for java.net.HttpURLConnection.HTTP_LENGTH_REQUIRED definition code for java.net.HttpURLConnection.HTTP_LENGTH_REQUIRED
          HTTP Status-Code 411: Length Required.
static int HTTP_MOVED_PERM sample code for java.net.HttpURLConnection.HTTP_MOVED_PERM definition code for java.net.HttpURLConnection.HTTP_MOVED_PERM
          HTTP Status-Code 301: Moved Permanently.
static int HTTP_MOVED_TEMP sample code for java.net.HttpURLConnection.HTTP_MOVED_TEMP definition code for java.net.HttpURLConnection.HTTP_MOVED_TEMP
          HTTP Status-Code 302: Temporary Redirect.
static int HTTP_MULT_CHOICE sample code for java.net.HttpURLConnection.HTTP_MULT_CHOICE definition code for java.net.HttpURLConnection.HTTP_MULT_CHOICE
          HTTP Status-Code 300: Multiple Choices.
static int HTTP_NO_CONTENT sample code for java.net.HttpURLConnection.HTTP_NO_CONTENT definition code for java.net.HttpURLConnection.HTTP_NO_CONTENT
          HTTP Status-Code 204: No Content.
static int HTTP_NOT_ACCEPTABLE sample code for java.net.HttpURLConnection.HTTP_NOT_ACCEPTABLE definition code for java.net.HttpURLConnection.HTTP_NOT_ACCEPTABLE
          HTTP Status-Code 406: Not Acceptable.
static int HTTP_NOT_AUTHORITATIVE sample code for java.net.HttpURLConnection.HTTP_NOT_AUTHORITATIVE definition code for java.net.HttpURLConnection.HTTP_NOT_AUTHORITATIVE
          HTTP Status-Code 203: Non-Authoritative Information.
static int HTTP_NOT_FOUND sample code for java.net.HttpURLConnection.HTTP_NOT_FOUND definition code for java.net.HttpURLConnection.HTTP_NOT_FOUND
          HTTP Status-Code 404: Not Found.
static int HTTP_NOT_IMPLEMENTED sample code for java.net.HttpURLConnection.HTTP_NOT_IMPLEMENTED definition code for java.net.HttpURLConnection.HTTP_NOT_IMPLEMENTED
          HTTP Status-Code 501: Not Implemented.
static int HTTP_NOT_MODIFIED sample code for java.net.HttpURLConnection.HTTP_NOT_MODIFIED definition code for java.net.HttpURLConnection.HTTP_NOT_MODIFIED
          HTTP Status-Code 304: Not Modified.
static int HTTP_OK sample code for java.net.HttpURLConnection.HTTP_OK definition code for java.net.HttpURLConnection.HTTP_OK
          HTTP Status-Code 200: OK.
static int HTTP_PARTIAL sample code for java.net.HttpURLConnection.HTTP_PARTIAL definition code for java.net.HttpURLConnection.HTTP_PARTIAL
          HTTP Status-Code 206: Partial Content.
static int HTTP_PAYMENT_REQUIRED sample code for java.net.HttpURLConnection.HTTP_PAYMENT_REQUIRED definition code for java.net.HttpURLConnection.HTTP_PAYMENT_REQUIRED
          HTTP Status-Code 402: Payment Required.
static int HTTP_PRECON_FAILED sample code for java.net.HttpURLConnection.HTTP_PRECON_FAILED definition code for java.net.HttpURLConnection.HTTP_PRECON_FAILED
          HTTP Status-Code 412: Precondition Failed.
static int HTTP_PROXY_AUTH sample code for java.net.HttpURLConnection.HTTP_PROXY_AUTH definition code for java.net.HttpURLConnection.HTTP_PROXY_AUTH
          HTTP Status-Code 407: Proxy Authentication Required.
static int HTTP_REQ_TOO_LONG sample code for java.net.HttpURLConnection.HTTP_REQ_TOO_LONG definition code for java.net.HttpURLConnection.HTTP_REQ_TOO_LONG
          HTTP Status-Code 414: Request-URI Too Large.
static int HTTP_RESET sample code for java.net.HttpURLConnection.HTTP_RESET definition code for java.net.HttpURLConnection.HTTP_RESET
          HTTP Status-Code 205: Reset Content.
static int HTTP_SEE_OTHER sample code for java.net.HttpURLConnection.HTTP_SEE_OTHER definition code for java.net.HttpURLConnection.HTTP_SEE_OTHER
          HTTP Status-Code 303: See Other.
static int HTTP_SERVER_ERROR sample code for java.net.HttpURLConnection.HTTP_SERVER_ERROR definition code for java.net.HttpURLConnection.HTTP_SERVER_ERROR
          Deprecated. it is misplaced and shouldn't have existed.
static int HTTP_UNAUTHORIZED sample code for java.net.HttpURLConnection.HTTP_UNAUTHORIZED definition code for java.net.HttpURLConnection.HTTP_UNAUTHORIZED
          HTTP Status-Code 401: Unauthorized.
static int HTTP_UNAVAILABLE sample code for java.net.HttpURLConnection.HTTP_UNAVAILABLE definition code for java.net.HttpURLConnection.HTTP_UNAVAILABLE
          HTTP Status-Code 503: Service Unavailable.
static int HTTP_UNSUPPORTED_TYPE sample code for java.net.HttpURLConnection.HTTP_UNSUPPORTED_TYPE definition code for java.net.HttpURLConnection.HTTP_UNSUPPORTED_TYPE
          HTTP Status-Code 415: Unsupported Media Type.
static int HTTP_USE_PROXY sample code for java.net.HttpURLConnection.HTTP_USE_PROXY definition code for java.net.HttpURLConnection.HTTP_USE_PROXY
          HTTP Status-Code 305: Use Proxy.
static int HTTP_VERSION sample code for java.net.HttpURLConnection.HTTP_VERSION definition code for java.net.HttpURLConnection.HTTP_VERSION
          HTTP Status-Code 505: HTTP Version Not Supported.
protected  boolean instanceFollowRedirects sample code for java.net.HttpURLConnection.instanceFollowRedirects definition code for java.net.HttpURLConnection.instanceFollowRedirects
          If true, the protocol will automatically follow redirects.
protected  String sample code for java.lang.String definition code for java.lang.String method sample code for java.net.HttpURLConnection.method definition code for java.net.HttpURLConnection.method
          The HTTP method (GET,POST,PUT,etc.).
protected  int responseCode sample code for java.net.HttpURLConnection.responseCode definition code for java.net.HttpURLConnection.responseCode
          An int representing the three digit HTTP Status-Code.
protected  String sample code for java.lang.String definition code for java.lang.String responseMessage sample code for java.net.HttpURLConnection.responseMessage definition code for java.net.HttpURLConnection.responseMessage
          The HTTP response message.
 
Fields inherited from class java.net.URLConnection sample code for java.net.URLConnection definition code for java.net.URLConnection
allowUserInteraction sample code for java.net.URLConnection.allowUserInteraction definition code for java.net.URLConnection.allowUserInteraction , connected sample code for java.net.URLConnection.connected definition code for java.net.URLConnection.connected , doInput sample code for java.net.URLConnection.doInput definition code for java.net.URLConnection.doInput , doOutput sample code for java.net.URLConnection.doOutput definition code for java.net.URLConnection.doOutput , ifModifiedSince sample code for java.net.URLConnection.ifModifiedSince definition code for java.net.URLConnection.ifModifiedSince , url sample code for java.net.URLConnection.url definition code for java.net.URLConnection.url , useCaches sample code for java.net.URLConnection.useCaches definition code for java.net.URLConnection.useCaches
 
Constructor Summary
protected HttpURLConnection sample code for java.net.HttpURLConnection.HttpURLConnection(java.net.URL) definition code for java.net.HttpURLConnection.HttpURLConnection(java.net.URL) (URL sample code for java.net.URL definition code for java.net.URL  u)
          Constructor for the HttpURLConnection.
 
Method Summary
abstract  void disconnect sample code for java.net.HttpURLConnection.disconnect() definition code for java.net.HttpURLConnection.disconnect() ()
          Indicates that other requests to the server are unlikely in the near future.
 InputStream sample code for java.io.InputStream definition code for java.io.InputStream getErrorStream sample code for java.net.HttpURLConnection.getErrorStream() definition code for java.net.HttpURLConnection.getErrorStream() ()
          Returns the error stream if the connection failed but the server sent useful data nonetheless.
static boolean getFollowRedirects sample code for java.net.HttpURLConnection.getFollowRedirects() definition code for java.net.HttpURLConnection.getFollowRedirects() ()
          Returns a boolean indicating whether or not HTTP redirects (3xx) should be automatically followed.
 String sample code for java.lang.String definition code for java.lang.String getHeaderField sample code for java.net.HttpURLConnection.getHeaderField(int) definition code for java.net.HttpURLConnection.getHeaderField(int) (int n)
          Returns the value for the nth header field.
 long getHeaderFieldDate sample code for java.net.HttpURLConnection.getHeaderFieldDate(java.lang.String, long) definition code for java.net.HttpURLConnection.getHeaderFieldDate(java.lang.String, long) (String sample code for java.lang.String definition code for java.lang.String  name, long Default)
          Returns the value of the named field parsed as date.
 String sample code for java.lang.String definition code for java.lang.String getHeaderFieldKey sample code for java.net.HttpURLConnection.getHeaderFieldKey(int) definition code for java.net.HttpURLConnection.getHeaderFieldKey(int) (int n)
          Returns the key for the nth header field.
 boolean getInstanceFollowRedirects sample code for java.net.HttpURLConnection.getInstanceFollowRedirects() definition code for java.net.HttpURLConnection.getInstanceFollowRedirects() ()
          Returns the value of this HttpURLConnection's instanceFollowRedirects field.
 Permission sample code for java.security.Permission definition code for java.security.Permission getPermission sample code for java.net.HttpURLConnection.getPermission() definition code for java.net.HttpURLConnection.getPermission() ()
          Returns a permission object representing the permission necessary to make the connection represented by this object.
 String sample code for java.lang.String definition code for java.lang.String getRequestMethod sample code for java.net.HttpURLConnection.getRequestMethod() definition code for java.net.HttpURLConnection.getRequestMethod() ()
          Get the request method.
 int getResponseCode sample code for java.net.HttpURLConnection.getResponseCode() definition code for java.net.HttpURLConnection.getResponseCode() ()
          Gets the status code from an HTTP response message.
 String sample code for java.lang.String definition code for java.lang.String getResponseMessage sample code for java.net.HttpURLConnection.getResponseMessage() definition code for java.net.HttpURLConnection.getResponseMessage() ()
          Gets the HTTP response message, if any, returned along with the response code from a server.
 void setChunkedStreamingMode sample code for java.net.HttpURLConnection.setChunkedStreamingMode(int) definition code for java.net.HttpURLConnection.setChunkedStreamingMode(int) (int chunklen)
          This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is not known in advance.
 void setFixedLengthStreamingMode sample code for java.net.HttpURLConnection.setFixedLengthStreamingMode(int) definition code for java.net.HttpURLConnection.setFixedLengthStreamingMode(int) (int contentLength)
          This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is known in advance.
static void setFollowRedirects sample code for java.net.HttpURLConnection.setFollowRedirects(boolean) definition code for java.net.HttpURLConnection.setFollowRedirects(boolean) (boolean set)
          Sets whether HTTP redirects (requests with response code 3xx) should be automatically followed by this class.
 void setInstanceFollowRedirects sample code for java.net.HttpURLConnection.setInstanceFollowRedirects(boolean) definition code for java.net.HttpURLConnection.setInstanceFollowRedirects(boolean) (boolean followRedirects)
          Sets whether HTTP redirects (requests with response code 3xx) should be automatically followed by this HttpURLConnection instance.
 void setRequestMethod sample code for java.net.HttpURLConnection.setRequestMethod(java.lang.String) definition code for java.net.HttpURLConnection.setRequestMethod(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  method)
          Set the method for the URL request, one of: GET POST HEAD OPTIONS PUT DELETE TRACE are legal, subject to protocol restrictions.
abstract  boolean usingProxy sample code for java.net.HttpURLConnection.usingProxy() definition code for java.net.HttpURLConnection.usingProxy() ()
          Indicates if the connection is going through a proxy.
 
Methods inherited from class java.net.URLConnection sample code for java.net.URLConnection definition code for java.net.URLConnection
addRequestProperty sample code for java.net.URLConnection.addRequestProperty(java.lang.String, java.lang.String) definition code for java.net.URLConnection.addRequestProperty(java.lang.String, java.lang.String) , connect sample code for java.net.URLConnection.connect() definition code for java.net.URLConnection.connect() , getAllowUserInteraction sample code for java.net.URLConnection.getAllowUserInteraction() definition code for java.net.URLConnection.getAllowUserInteraction() , getConnectTimeout sample code for java.net.URLConnection.getConnectTimeout() definition code for java.net.URLConnection.getConnectTimeout() , getContent sample code for java.net.URLConnection.getContent() definition code for java.net.URLConnection.getContent() , getContent sample code for java.net.URLConnection.getContent(java.lang.Class[]) definition code for java.net.URLConnection.getContent(java.lang.Class[]) , getContentEncoding sample code for java.net.URLConnection.getContentEncoding() definition code for java.net.URLConnection.getContentEncoding() , getContentLength sample code for java.net.URLConnection.getContentLength() definition code for java.net.URLConnection.getContentLength() , getContentType sample code for java.net.URLConnection.getContentType() definition code for java.net.URLConnection.getContentType() , getDate sample code for java.net.URLConnection.getDate() definition code for java.net.URLConnection.getDate() , getDefaultAllowUserInteraction sample code for java.net.URLConnection.getDefaultAllowUserInteraction() definition code for java.net.URLConnection.getDefaultAllowUserInteraction() , getDefaultRequestProperty sample code for java.net.URLConnection.getDefaultRequestProperty(java.lang.String) definition code for java.net.URLConnection.getDefaultRequestProperty(java.lang.String) , getDefaultUseCaches sample code for java.net.URLConnection.getDefaultUseCaches() definition code for java.net.URLConnection.getDefaultUseCaches() , getDoInput sample code for java.net.URLConnection.getDoInput() definition code for java.net.URLConnection.getDoInput() , getDoOutput sample code for java.net.URLConnection.getDoOutput() definition code for java.net.URLConnection.getDoOutput() , getExpiration sample code for java.net.URLConnection.getExpiration() definition code for java.net.URLConnection.getExpiration() , getFileNameMap sample code for java.net.URLConnection.getFileNameMap() definition code for java.net.URLConnection.getFileNameMap() , getHeaderField sample code for java.net.URLConnection.getHeaderField(java.lang.String) definition code for java.net.URLConnection.getHeaderField(java.lang.String) , getHeaderFieldInt sample code for java.net.URLConnection.getHeaderFieldInt(java.lang.String, int) definition code for java.net.URLConnection.getHeaderFieldInt(java.lang.String, int) , getHeaderFields sample code for java.net.URLConnection.getHeaderFields() definition code for java.net.URLConnection.getHeaderFields() , getIfModifiedSince sample code for java.net.URLConnection.getIfModifiedSince() definition code for java.net.URLConnection.getIfModifiedSince() , getInputStream sample code for java.net.URLConnection.getInputStream() definition code for java.net.URLConnection.getInputStream() , getLastModified sample code for java.net.URLConnection.getLastModified() definition code for java.net.URLConnection.getLastModified() , getOutputStream sample code for java.net.URLConnection.getOutputStream() definition code for java.net.URLConnection.getOutputStream() , getReadTimeout sample code for java.net.URLConnection.getReadTimeout() definition code for java.net.URLConnection.getReadTimeout() , getRequestProperties sample code for java.net.URLConnection.getRequestProperties() definition code for java.net.URLConnection.getRequestProperties() , getRequestProperty sample code for java.net.URLConnection.getRequestProperty(java.lang.String) definition code for java.net.URLConnection.getRequestProperty(java.lang.String) , getURL sample code for java.net.URLConnection.getURL() definition code for java.net.URLConnection.getURL() , getUseCaches sample code for java.net.URLConnection.getUseCaches() definition code for java.net.URLConnection.getUseCaches() , guessContentTypeFromName sample code for java.net.URLConnection.guessContentTypeFromName(java.lang.String) definition code for java.net.URLConnection.guessContentTypeFromName(java.lang.String) , guessContentTypeFromStream sample code for java.net.URLConnection.guessContentTypeFromStream(java.io.InputStream) definition code for java.net.URLConnection.guessContentTypeFromStream(java.io.InputStream) , setAllowUserInteraction sample code for java.net.URLConnection.setAllowUserInteraction(boolean) definition code for java.net.URLConnection.setAllowUserInteraction(boolean) , setConnectTimeout sample code for java.net.URLConnection.setConnectTimeout(int) definition code for java.net.URLConnection.setConnectTimeout(int) , setContentHandlerFactory sample code for java.net.URLConnection.setContentHandlerFactory(java.net.ContentHandlerFactory) definition code for java.net.URLConnection.setContentHandlerFactory(java.net.ContentHandlerFactory) , setDefaultAllowUserInteraction sample code for java.net.URLConnection.setDefaultAllowUserInteraction(boolean) definition code for java.net.URLConnection.setDefaultAllowUserInteraction(boolean) , setDefaultRequestProperty sample code for java.net.URLConnection.setDefaultRequestProperty(java.lang.String, java.lang.String) definition code for java.net.URLConnection.setDefaultRequestProperty(java.lang.String, java.lang.String) , setDefaultUseCaches sample code for java.net.URLConnection.setDefaultUseCaches(boolean) definition code for java.net.URLConnection.setDefaultUseCaches(boolean) , setDoInput sample code for java.net.URLConnection.setDoInput(boolean) definition code for java.net.URLConnection.setDoInput(boolean) , setDoOutput sample code for java.net.URLConnection.setDoOutput(boolean) definition code for java.net.URLConnection.setDoOutput(boolean) , setFileNameMap sample code for java.net.URLConnection.setFileNameMap(java.net.FileNameMap) definition code for java.net.URLConnection.setFileNameMap(java.net.FileNameMap) , setIfModifiedSince sample code for java.net.URLConnection.setIfModifiedSince(long) definition code for java.net.URLConnection.setIfModifiedSince(long) , setReadTimeout sample code for java.net.URLConnection.setReadTimeout(int) definition code for java.net.URLConnection.setReadTimeout(int) , setRequestProperty sample code for java.net.URLConnection.setRequestProperty(java.lang.String, java.lang.String) definition code for java.net.URLConnection.setRequestProperty(java.lang.String, java.lang.String) , setUseCaches sample code for java.net.URLConnection.setUseCaches(boolean) definition code for java.net.URLConnection.setUseCaches(boolean) , toString sample code for java.net.URLConnection.toString() definition code for java.net.URLConnection.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

method sample code for java.net.HttpURLConnection.method

protected String sample code for java.lang.String definition code for java.lang.String  method
The HTTP method (GET,POST,PUT,etc.).


chunkLength sample code for java.net.HttpURLConnection.chunkLength

protected int chunkLength
The chunk-length when using chunked encoding streaming mode for output. A value of -1 means chunked encoding is disabled for output.


fixedContentLength sample code for java.net.HttpURLConnection.fixedContentLength

protected int fixedContentLength
The fixed content-length when using fixed-length streaming mode. A value of -1 means fixed-length streaming mode is disabled for output.


responseCode sample code for java.net.HttpURLConnection.responseCode

protected int responseCode
An int representing the three digit HTTP Status-Code.


responseMessage sample code for java.net.HttpURLConnection.responseMessage

protected String sample code for java.lang.String definition code for java.lang.String  responseMessage
The HTTP response message.


instanceFollowRedirects sample code for java.net.HttpURLConnection.instanceFollowRedirects

protected boolean instanceFollowRedirects
If true, the protocol will automatically follow redirects. If false, the protocol will not automatically follow redirects.

This field is set by the setInstanceFollowRedirects method. Its value is returned by the getInstanceFollowRedirects method.

Its default value is based on the value of the static followRedirects at HttpURLConnection construction time.

See Also:
setInstanceFollowRedirects(boolean) sample code for java.net.HttpURLConnection.setInstanceFollowRedirects(boolean) definition code for java.net.HttpURLConnection.setInstanceFollowRedirects(boolean) , getInstanceFollowRedirects() sample code for java.net.HttpURLConnection.getInstanceFollowRedirects() definition code for java.net.HttpURLConnection.getInstanceFollowRedirects() , setFollowRedirects(boolean) sample code for java.net.HttpURLConnection.setFollowRedirects(boolean) definition code for java.net.HttpURLConnection.setFollowRedirects(boolean)