DthingApi
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
java.net.http.HttpURLConnection Class Reference
Inheritance diagram for java.net.http.HttpURLConnection:
java.net.http.URLConnection

Public Member Functions

void connect () throws IOException
 
InputStream getInputStream () throws IOException
 
OutputStream getOutputStream () throws IOException
 
int getDefaultPort ()
 
void disconnect ()
 
InputStream getErrorStream ()
 
String getHeaderField (int idx)
 
String getHeaderField (String name)
 
long getHeaderFieldDate (String name, long Default)
 
String getHeaderFieldKey (int n)
 
boolean getInstanceFollowRedirects ()
 
void setInstanceFollowRedirects ()
 
int getResponseCode () throws IOException
 
String getResponseMessage () throws IOException
 
void setChunkedStreamingMode (int chunklen)
 
void setFixedLengthStreamingMode (int contentlen)
 
void setRequestMethod (String method) throws ProtocolException
 
String getRequestMethod ()
 
- Public Member Functions inherited from java.net.http.URLConnection
abstract void connect () throws IOException
 
URL getURL ()
 
int getContentLength ()
 
String getContentType ()
 
String getContentEncoding ()
 
long getExpiration ()
 
long getDate ()
 
long getLastModified ()
 
void setConnectTimeout (int timeout)
 
int getConnectTimeout ()
 
void setReadTimeout (int timeout)
 
int getReadTimeout ()
 
String getHeaderField (String name)
 
String getHeaderField (int idx)
 
int getHeaderFieldInt (String name, int Default)
 
long getHeaderFieldDate (String name, long Default)
 
String getHeaderFieldKey (int n)
 
Object getContent () throws IOException
 
Object getContent (Class[] classes) throws IOException
 
abstract InputStream getInputStream () throws IOException
 
abstract OutputStream getOutputStream () throws IOException
 
String toString ()
 
void setDoInput (boolean doinput)
 
boolean getDoInput ()
 
void setDoOutput (boolean dooutput)
 
boolean getDoOutput ()
 
void setAllowUserInteraction (boolean allowuserinteraction)
 
boolean getAllowUserInteraction ()
 
void setUseCaches (boolean usecaches)
 
boolean getUseCaches ()
 
void setIfModifiedSince (long ifmodifiedsince)
 
long getIfModifiedSince ()
 
boolean getDefaultUseCaches ()
 
void setDefaultUseCaches (boolean defaultusecaches)
 
void setRequestProperty (String key, String value)
 
void addRequestProperty (String key, String value)
 
String getRequestProperty (String key)
 
Map< String, List< String > > getRequestProperties ()
 

Static Public Member Functions

static boolean getFollowRedirects ()
 
static void setFollowRedirects (boolean set)
 
- Static Public Member Functions inherited from java.net.http.URLConnection
static void setDefaultAllowUserInteraction (boolean defaultallowuserinteraction)
 
static boolean getDefaultAllowUserInteraction ()
 
static synchronized void setContentHandlerFactory (ContentHandlerFactory fac)
 
static String guessContentTypeFromName (String fname)
 
static String guessContentTypeFromStream (InputStream is) throws IOException
 

Static Public Attributes

static final String GET = "GET"
 
static final String POST = "POST"
 
static final String HEAD = "HEAD"
 
static final String OPTIONS = "OPTIONS"
 
static final String PUT = "PUT"
 
static final String DELETE = "DELETE"
 
static final String TRACE = "TRACE"
 
static final int HTTP_ACCEPTED = 202
 
static final int HTTP_BAD_GATEWAY = 502
 
static final int HTTP_BAD_METHOD = 405
 
static final int HTTP_BAD_REQUEST = 400
 
static final int HTTP_CLIENT_TIMEOUT = 408
 
static final int HTTP_CONFLICT = 409
 
static final int HTTP_CREATED = 201
 
static final int HTTP_ENTITY_TOO_LARGE = 413
 
static final int HTTP_FORBIDDEN = 403
 
static final int HTTP_GATEWAY_TIMEOUT = 504
 
static final int HTTP_GONE = 410
 
static final int HTTP_INTERNAL_ERROR = 500
 
static final int HTTP_LENGTH_REQUIRED = 411
 
static final int HTTP_MOVED_PERM = 301
 
static final int HTTP_MOVED_TEMP = 302
 
static final int HTTP_MULT_CHOICE = 300
 
static final int HTTP_NO_CONTENT = 204
 
static final int HTTP_NOT_ACCEPTABLE = 406
 
static final int HTTP_NOT_AUTHORITATIVE = 203
 
static final int HTTP_NOT_FOUND = 404
 
static final int HTTP_NOT_IMPLEMENTED = 501
 
static final int HTTP_NOT_MODIFIED = 304
 
static final int HTTP_OK = 200
 
static final int HTTP_PARTIAL = 206
 
static final int HTTP_PAYMENT_REQUIRED = 402
 
static final int HTTP_PRECON_FAILED = 412
 
static final int HTTP_PROXY_AUTH = 407
 
static final int HTTP_REQ_TOO_LONG = 414
 
static final int HTTP_RESET = 205
 
static final int HTTP_SEE_OTHER = 303
 
static final int HTTP_USE_PROXY = 305
 
static final int HTTP_UNAUTHORIZED = 401
 
static final int HTTP_UNSUPPORTED_TYPE = 415
 
static final int HTTP_UNAVAILABLE = 503
 
static final int HTTP_VERSION = 505
 

Protected Member Functions

 HttpURLConnection (URL url)
 
- Protected Member Functions inherited from java.net.http.URLConnection
 URLConnection (URL url)
 
int getDefaultPort ()
 

Additional Inherited Members

- Protected Attributes inherited from java.net.http.URLConnection
URL url
 
boolean doInput = true
 
boolean doOutput = false
 
boolean allowUserInteraction = defaultAllowUserInteraction
 
boolean useCaches = defaultUseCaches
 
long ifModifiedSince = 0
 
boolean connected = false
 
int connectTimeout = 0
 
int readTimeout = 0
 
HashMap< String, String > requestProperties
 
LinkedHashMap< String, String > responseProperties
 

Member Function Documentation

◆ getResponseCode()

int java.net.http.HttpURLConnection.getResponseCode ( ) throws IOException
inline

Get the HTTP response code

Returns
the response code if successfully get HTTP response, -1 otherwise.
Exceptions
IOException

Member Data Documentation

◆ HTTP_ACCEPTED

final int java.net.http.HttpURLConnection.HTTP_ACCEPTED = 202
static

Numeric status code, 202: Accepted

◆ HTTP_BAD_GATEWAY

final int java.net.http.HttpURLConnection.HTTP_BAD_GATEWAY = 502
static

Numeric status code, 502: Bad Gateway

◆ HTTP_BAD_METHOD

final int java.net.http.HttpURLConnection.HTTP_BAD_METHOD = 405
static

Numeric status code, 405: Bad Method

◆ HTTP_BAD_REQUEST

final int java.net.http.HttpURLConnection.HTTP_BAD_REQUEST = 400
static

Numeric status code, 400: Bad Request

◆ HTTP_CLIENT_TIMEOUT

final int java.net.http.HttpURLConnection.HTTP_CLIENT_TIMEOUT = 408
static

Numeric status code, 408: Client Timeout

◆ HTTP_CONFLICT

final int java.net.http.HttpURLConnection.HTTP_CONFLICT = 409
static

Numeric status code, 409: Conflict

◆ HTTP_CREATED

final int java.net.http.HttpURLConnection.HTTP_CREATED = 201
static

Numeric status code, 201: Created

◆ HTTP_ENTITY_TOO_LARGE

final int java.net.http.HttpURLConnection.HTTP_ENTITY_TOO_LARGE = 413
static

Numeric status code, 413: Entity too large

◆ HTTP_FORBIDDEN

final int java.net.http.HttpURLConnection.HTTP_FORBIDDEN = 403
static

Numeric status code, 403: Forbidden

◆ HTTP_GATEWAY_TIMEOUT

final int java.net.http.HttpURLConnection.HTTP_GATEWAY_TIMEOUT = 504
static

Numeric status code, 504: Gateway timeout

◆ HTTP_GONE

final int java.net.http.HttpURLConnection.HTTP_GONE = 410
static

Numeric status code, 410: Gone

◆ HTTP_INTERNAL_ERROR

final int java.net.http.HttpURLConnection.HTTP_INTERNAL_ERROR = 500
static

Numeric status code, 500: Internal error

◆ HTTP_LENGTH_REQUIRED

final int java.net.http.HttpURLConnection.HTTP_LENGTH_REQUIRED = 411
static

Numeric status code, 411: Length required

◆ HTTP_MOVED_PERM

final int java.net.http.HttpURLConnection.HTTP_MOVED_PERM = 301
static

Numeric status code, 301 Moved permanently

◆ HTTP_MOVED_TEMP

final int java.net.http.HttpURLConnection.HTTP_MOVED_TEMP = 302
static

Numeric status code, 302: Moved temporarily

◆ HTTP_MULT_CHOICE

final int java.net.http.HttpURLConnection.HTTP_MULT_CHOICE = 300
static

Numeric status code, 300: Multiple choices

◆ HTTP_NO_CONTENT

final int java.net.http.HttpURLConnection.HTTP_NO_CONTENT = 204
static

Numeric status code, 204: No content

◆ HTTP_NOT_ACCEPTABLE

final int java.net.http.HttpURLConnection.HTTP_NOT_ACCEPTABLE = 406
static

Numeric status code, 406: Not acceptable

◆ HTTP_NOT_AUTHORITATIVE

final int java.net.http.HttpURLConnection.HTTP_NOT_AUTHORITATIVE = 203
static

Numeric status code, 203: Not authoritative

◆ HTTP_NOT_FOUND

final int java.net.http.HttpURLConnection.HTTP_NOT_FOUND = 404
static

Numeric status code, 404: Not found

◆ HTTP_NOT_IMPLEMENTED

final int java.net.http.HttpURLConnection.HTTP_NOT_IMPLEMENTED = 501
static

Numeric status code, 501: Not implemented

◆ HTTP_NOT_MODIFIED

final int java.net.http.HttpURLConnection.HTTP_NOT_MODIFIED = 304
static

Numeric status code, 304: Not modified

◆ HTTP_OK

final int java.net.http.HttpURLConnection.HTTP_OK = 200
static

Numeric status code, 200: OK

◆ HTTP_PARTIAL

final int java.net.http.HttpURLConnection.HTTP_PARTIAL = 206
static

Numeric status code, 206: Partial

◆ HTTP_PAYMENT_REQUIRED

final int java.net.http.HttpURLConnection.HTTP_PAYMENT_REQUIRED = 402
static

Numeric status code, 402: Payment required

◆ HTTP_PRECON_FAILED

final int java.net.http.HttpURLConnection.HTTP_PRECON_FAILED = 412
static

Numeric status code, 412: Precondition failed

◆ HTTP_PROXY_AUTH

final int java.net.http.HttpURLConnection.HTTP_PROXY_AUTH = 407
static

Numeric status code, 407: Proxy authentication required

◆ HTTP_REQ_TOO_LONG

final int java.net.http.HttpURLConnection.HTTP_REQ_TOO_LONG = 414
static

Numeric status code, 414: Request too long

◆ HTTP_RESET

final int java.net.http.HttpURLConnection.HTTP_RESET = 205
static

Numeric status code, 205: Reset

◆ HTTP_SEE_OTHER

final int java.net.http.HttpURLConnection.HTTP_SEE_OTHER = 303
static

Numeric status code, 303: See other

◆ HTTP_UNAUTHORIZED

final int java.net.http.HttpURLConnection.HTTP_UNAUTHORIZED = 401
static

Numeric status code, 401: Unauthorized

◆ HTTP_UNAVAILABLE

final int java.net.http.HttpURLConnection.HTTP_UNAVAILABLE = 503
static

Numeric status code, 503: Unavailable

◆ HTTP_UNSUPPORTED_TYPE

final int java.net.http.HttpURLConnection.HTTP_UNSUPPORTED_TYPE = 415
static

Numeric status code, 415: Unsupported type

◆ HTTP_USE_PROXY

final int java.net.http.HttpURLConnection.HTTP_USE_PROXY = 305
static

Numeric status code, 305: Use proxy

◆ HTTP_VERSION

final int java.net.http.HttpURLConnection.HTTP_VERSION = 505
static

Numeric status code, 505: Version not supported


The documentation for this class was generated from the following file: