Package org.eclipse.sw360.http.utils
Class HttpConstants
- java.lang.Object
-
- org.eclipse.sw360.http.utils.HttpConstants
-
public final class HttpConstants extends Object
A class defining some frequently used constants related to HTTP requests and responses.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTH_BASICConstant for the authentication scheme Basic Auth.static StringAUTH_BEARERConstant for the authentication scheme used for bearer tokens.static StringCHARSET_UTF8Constant for the charset UTF-8.static StringCONTENT_ALL_STREAMConstant for the content type application/octet-stream.static StringCONTENT_JSONConstant for the content type application/json.static StringCONTENT_JSON_UTF8Constant for the content type application/json with UTF-8 encoding.static StringCONTENT_OCTET_STREAMConstant for the content type application/octet-stream.static StringCONTENT_TEXT_PLAINConstant for the content type text/plain.static StringCONTENT_TYPE_FORMConstant for the content type for URL-encoded forms.static StringHEADER_ACCEPTConstant for the HTTP header for defining the media type(s) accepted by the client.static StringHEADER_AUTHORIZATIONConstant for the HTTP Authorization header.static StringHEADER_CONTENT_TYPEConstant for the HTTP header for setting the content type.static intSTATUS_ACCEPTEDConstant for the HTTP status code 202 ACCEPTED indicating that a request is processed asynchronously.static intSTATUS_CREATEDConstant for the HTTP status code 201 CREATED indicating that a resource has been created successfully.static intSTATUS_ERR_BAD_REQUESTConstant for the HTTP status code 400 BAD REQUEST indicating a general problem with a request sent by a client.static intSTATUS_ERR_NOT_FOUNDConstant for the HTTP status code 404 NOT FOUND indicating that the resource requested does not exist.static intSTATUS_ERR_SERVERConstant for the HTTP status code 500 INTERNAL SERVER ERROR indicating a general problem on server side.static intSTATUS_ERR_UNAUTHORIZEDConstant for the HTTP status code 401 UNAUTHORIZED indicating missing or invalid access credentials.static intSTATUS_MULTI_STATUSConstant for the HTTP status code 207 MULTI_STATUS that is returned for operations affecting multiple entities.static intSTATUS_NO_CONTENTConstant for the HTTP status code 204 NO_CONTENT indicating that a request has a null body.static intSTATUS_OKConstant for the HTTP status code 200 OK, indicating a successful request.static StringURL_PATH_SEPARATORConstant for the character used as separator between URL path segments.
-
-
-
Field Detail
-
STATUS_OK
public static final int STATUS_OK
Constant for the HTTP status code 200 OK, indicating a successful request.- See Also:
- Constant Field Values
-
STATUS_CREATED
public static final int STATUS_CREATED
Constant for the HTTP status code 201 CREATED indicating that a resource has been created successfully.- See Also:
- Constant Field Values
-
STATUS_ACCEPTED
public static final int STATUS_ACCEPTED
Constant for the HTTP status code 202 ACCEPTED indicating that a request is processed asynchronously.- See Also:
- Constant Field Values
-
STATUS_NO_CONTENT
public static final int STATUS_NO_CONTENT
Constant for the HTTP status code 204 NO_CONTENT indicating that a request has a null body.- See Also:
- Constant Field Values
-
STATUS_MULTI_STATUS
public static final int STATUS_MULTI_STATUS
Constant for the HTTP status code 207 MULTI_STATUS that is returned for operations affecting multiple entities. The response body typically contains more information about the single operations and their outcome.- See Also:
- Constant Field Values
-
STATUS_ERR_BAD_REQUEST
public static final int STATUS_ERR_BAD_REQUEST
Constant for the HTTP status code 400 BAD REQUEST indicating a general problem with a request sent by a client.- See Also:
- Constant Field Values
-
STATUS_ERR_UNAUTHORIZED
public static final int STATUS_ERR_UNAUTHORIZED
Constant for the HTTP status code 401 UNAUTHORIZED indicating missing or invalid access credentials.- See Also:
- Constant Field Values
-
STATUS_ERR_NOT_FOUND
public static final int STATUS_ERR_NOT_FOUND
Constant for the HTTP status code 404 NOT FOUND indicating that the resource requested does not exist.- See Also:
- Constant Field Values
-
STATUS_ERR_SERVER
public static final int STATUS_ERR_SERVER
Constant for the HTTP status code 500 INTERNAL SERVER ERROR indicating a general problem on server side.- See Also:
- Constant Field Values
-
HEADER_CONTENT_TYPE
public static final String HEADER_CONTENT_TYPE
Constant for the HTTP header for setting the content type.- See Also:
- Constant Field Values
-
HEADER_ACCEPT
public static final String HEADER_ACCEPT
Constant for the HTTP header for defining the media type(s) accepted by the client.- See Also:
- Constant Field Values
-
HEADER_AUTHORIZATION
public static final String HEADER_AUTHORIZATION
Constant for the HTTP Authorization header.- See Also:
- Constant Field Values
-
AUTH_BASIC
public static final String AUTH_BASIC
Constant for the authentication scheme Basic Auth.- See Also:
- Constant Field Values
-
AUTH_BEARER
public static final String AUTH_BEARER
Constant for the authentication scheme used for bearer tokens. This scheme is used when an OAuth 2.0 access token needs to be passed to the server.- See Also:
- Constant Field Values
-
CHARSET_UTF8
public static final String CHARSET_UTF8
Constant for the charset UTF-8. This declaration can be appended to some content types to make the charset used explicit.- See Also:
- Constant Field Values
-
CONTENT_OCTET_STREAM
public static final String CONTENT_OCTET_STREAM
Constant for the content type application/octet-stream.- See Also:
- Constant Field Values
-
CONTENT_ALL_STREAM
public static final String CONTENT_ALL_STREAM
Constant for the content type application/octet-stream.- See Also:
- Constant Field Values
-
CONTENT_JSON
public static final String CONTENT_JSON
Constant for the content type application/json.- See Also:
- Constant Field Values
-
CONTENT_JSON_UTF8
public static final String CONTENT_JSON_UTF8
Constant for the content type application/json with UTF-8 encoding.- See Also:
- Constant Field Values
-
CONTENT_TEXT_PLAIN
public static final String CONTENT_TEXT_PLAIN
Constant for the content type text/plain.- See Also:
- Constant Field Values
-
CONTENT_TYPE_FORM
public static final String CONTENT_TYPE_FORM
Constant for the content type for URL-encoded forms.- See Also:
- Constant Field Values
-
URL_PATH_SEPARATOR
public static final String URL_PATH_SEPARATOR
Constant for the character used as separator between URL path segments.- See Also:
- Constant Field Values
-
-