HttpURLConnection Members

HttpURLConnection Members

Class Overview | This Package | All Packages

Fields
Name Description
HTTP_ACCEPTED  
HTTP_BAD_GATEWAY  
HTTP_BAD_METHOD  
HTTP_BAD_REQUEST 4XX: client error
HTTP_CLIENT_TIMEOUT  
HTTP_CONFLICT  
HTTP_CREATED  
HTTP_ENTITY_TOO_LARGE  
HTTP_FORBIDDEN  
HTTP_GATEWAY_TIMEOUT  
HTTP_GONE  
HTTP_INTERNAL_ERROR  
HTTP_LENGTH_REQUIRED  
HTTP_MOVED_PERM  
HTTP_MOVED_TEMP  
HTTP_MULT_CHOICE 3XX: relocation/redirect
HTTP_NO_CONTENT  
HTTP_NOT_ACCEPTABLE  
HTTP_NOT_AUTHORITATIVE  
HTTP_NOT_FOUND  
HTTP_NOT_MODIFIED  
HTTP_OK 2XX: generally "OK"
HTTP_PARTIAL  
HTTP_PAYMENT_REQUIRED  
HTTP_PRECON_FAILED  
HTTP_PROXY_AUTH  
HTTP_REQ_TOO_LONG  
HTTP_RESET  
HTTP_SEE_OTHER  
HTTP_SERVER_ERROR 5XX: server error
HTTP_UNAUTHORIZED  
HTTP_UNAVAILABLE  
HTTP_UNSUPPORTED_TYPE  
HTTP_USE_PROXY  
HTTP_VERSION  
method  
responseCode  
responseMessage  

Constructors
Name Description
HttpURLConnection(URL) Constructor for the URLStreamHandler.

Methods
Name Description
disconnect() Close the connection to the server.
getFollowRedirects()  
getRequestMethod() Get the request method.
getResponseCode() Gets HTTP response status.
getResponseMessage() Gets the HTTP response message, if any, returned along with the response code from a server.
setFollowRedirects(boolean) Sets whether HTTP redirects (requests with response code 3xx) should be automatically followed by this class.
setRequestMethod(String) Set the method for the URL request, one of:
  • GET
  • POST
  • HEAD
  • OPTIONS
  • PUT
  • DELETE
  • TRACE
are legal, subject to protocol restrictions.
usingProxy() Indicates if the connection is going through a proxy.