Class HttpConstants


  • public final class HttpConstants
    extends Object

    A class defining some frequently used constants related to HTTP requests and responses.

    • 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_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