Class HttpHeaderName


public final class HttpHeaderName extends ExpandableStringEnum<HttpHeaderName>

Represents HTTP header names for multiple versions of HTTP.

This class encapsulates the name of an HTTP header in a case-insensitive manner. It provides methods to access the case-sensitive and case-insensitive versions of the header name.

It also provides constants for commonly used HTTP header names. For example, you can use CONTENT_TYPE to get the Content-Type header name, and AUTHORIZATION to get the Authorization header name.

This class is useful when you want to work with the names of HTTP headers in a case-insensitive manner, or when you want to use the predefined constants for commonly used HTTP header names.

Note: This class extends ExpandableStringEnum, so it can be used in the same way as other expandable string enums. For example, you can use the fromString(String) method to get an instance of this class from a string.

  • Field Details

    • ACCEPT

      public static final HttpHeaderName ACCEPT
      Accept/accept
    • ACCEPT_CHARSET

      public static final HttpHeaderName ACCEPT_CHARSET
      Accept-Charset/accept-charset
    • ACCESS_CONTROL_ALLOW_CREDENTIALS

      public static final HttpHeaderName ACCESS_CONTROL_ALLOW_CREDENTIALS
      Access-Control-Allow-Credentials/access-control-allow-credentials
    • ACCESS_CONTROL_ALLOW_HEADERS

      public static final HttpHeaderName ACCESS_CONTROL_ALLOW_HEADERS
      Access-Control-Allow-Headers/access-control-allow-headers
    • ACCESS_CONTROL_ALLOW_METHODS

      public static final HttpHeaderName ACCESS_CONTROL_ALLOW_METHODS
      Access-Control-Allow-Methods/access-control-allow-methods
    • ACCESS_CONTROL_ALLOW_ORIGIN

      public static final HttpHeaderName ACCESS_CONTROL_ALLOW_ORIGIN
      Access-Control-Allow-Origin/access-control-allow-origin
    • ACCESS_CONTROL_EXPOSE_HEADERS

      public static final HttpHeaderName ACCESS_CONTROL_EXPOSE_HEADERS
      Access-Control-Expose-Headers/access-control-expose-headers
    • ACCESS_CONTROL_MAX_AGE

      public static final HttpHeaderName ACCESS_CONTROL_MAX_AGE
      Access-Control-Max-Age/access-control-max-age
    • ACCEPT_DATETIME

      public static final HttpHeaderName ACCEPT_DATETIME
      Accept-Datetime/accept-datetime
    • ACCEPT_ENCODING

      public static final HttpHeaderName ACCEPT_ENCODING
      Accept-Encoding/accept-encoding
    • ACCEPT_LANGUAGE

      public static final HttpHeaderName ACCEPT_LANGUAGE
      Accept-Language/accept-language
    • ACCEPT_PATCH

      public static final HttpHeaderName ACCEPT_PATCH
      Accept-Patch/accept-patch
    • ACCEPT_RANGES

      public static final HttpHeaderName ACCEPT_RANGES
      Accept-Ranges/accept-ranges
    • AGE

      public static final HttpHeaderName AGE
      Age/age
    • ALLOW

      public static final HttpHeaderName ALLOW
      Allow/allow
    • AUTHORIZATION

      public static final HttpHeaderName AUTHORIZATION
      Authorization/authorization
    • AZURE_ASYNCOPERATION

      public static final HttpHeaderName AZURE_ASYNCOPERATION
      Azure-AsyncOperation/azure-azyncoperation
    • CACHE_CONTROL

      public static final HttpHeaderName CACHE_CONTROL
      Cache-Control/cache-control
    • CONNECTION

      public static final HttpHeaderName CONNECTION
      Connection/connection
    • CONTENT_DISPOSITION

      public static final HttpHeaderName CONTENT_DISPOSITION
      Content-Disposition/content-disposition
    • CONTENT_ENCODING

      public static final HttpHeaderName CONTENT_ENCODING
      Content-Encoding/content-encoding
    • CONTENT_LANGUAGE

      public static final HttpHeaderName CONTENT_LANGUAGE
      Content-Language/content-language
    • CONTENT_LENGTH

      public static final HttpHeaderName CONTENT_LENGTH
      Content-Length/content-length
    • CONTENT_LOCATION

      public static final HttpHeaderName CONTENT_LOCATION
      Content-Location/content-location
    • CONTENT_MD5

      public static final HttpHeaderName CONTENT_MD5
      Content-MD5/content-md5
    • CONTENT_RANGE

      public static final HttpHeaderName CONTENT_RANGE
      Content-Range/content-range
    • CONTENT_TYPE

      public static final HttpHeaderName CONTENT_TYPE
      Content-Type/content-type
    • DATE

      public static final HttpHeaderName DATE
      Date/date
    • ETAG

      public static final HttpHeaderName ETAG
      ETag/etag
    • EXPECT

      public static final HttpHeaderName EXPECT
      Expect/expect
    • EXPIRES

      public static final HttpHeaderName EXPIRES
      Expires/expires
    • FORWARDED

      public static final HttpHeaderName FORWARDED
      Forwarded/forwarded
    • FROM

      public static final HttpHeaderName FROM
      From/from
    • HOST

      public static final HttpHeaderName HOST
      Host/host
    • HTTP2_SETTINGS

      public static final HttpHeaderName HTTP2_SETTINGS
      HTTP2-Settings/http2-settings
    • IF_MATCH

      public static final HttpHeaderName IF_MATCH
      If-Match/if-match
    • IF_MODIFIED_SINCE

      public static final HttpHeaderName IF_MODIFIED_SINCE
      If-Modified-Since/if-modified-since
    • IF_NONE_MATCH

      public static final HttpHeaderName IF_NONE_MATCH
      If-None-Match/if-none-match
    • IF_RANGE

      public static final HttpHeaderName IF_RANGE
      If-Range/if-range
    • IF_UNMODIFIED_SINCE

      public static final HttpHeaderName IF_UNMODIFIED_SINCE
      If-Unmodified-Since/if-unmodified-since
    • LAST_MODIFIED

      public static final HttpHeaderName LAST_MODIFIED
      Last-Modified/last-modified
    • LOCATION

      public static final HttpHeaderName LOCATION
      Location/location
    • MAX_FORWARDS

      public static final HttpHeaderName MAX_FORWARDS
      Max-Forwards/max-forwards
    • OPERATION_LOCATION

      public static final HttpHeaderName OPERATION_LOCATION
      Operation-Location/operation-location
    • ORIGIN

      public static final HttpHeaderName ORIGIN
      Origin/origin
    • PRAGMA

      public static final HttpHeaderName PRAGMA
      Pragma/pragma
    • PREFER

      public static final HttpHeaderName PREFER
      Prefer/prefer
    • PREFERENCE_APPLIED

      public static final HttpHeaderName PREFERENCE_APPLIED
      Preference-Applied/preference-applied
    • PROXY_AUTHENTICATE

      public static final HttpHeaderName PROXY_AUTHENTICATE
      Proxy-Authenticate/proxy-authenticate
    • PROXY_AUTHORIZATION

      public static final HttpHeaderName PROXY_AUTHORIZATION
      Proxy-Authorization/proxy-authorization
    • RANGE

      public static final HttpHeaderName RANGE
      Range/range
    • REFERER

      public static final HttpHeaderName REFERER
      Referer/referer
    • RETRY_AFTER

      public static final HttpHeaderName RETRY_AFTER
      Retry-After/retry-after
    • RETRY_AFTER_MS

      public static final HttpHeaderName RETRY_AFTER_MS
      retry-after-ms
    • SERVER

      public static final HttpHeaderName SERVER
      Server/server
    • STRICT_TRANSPORT_SECURITY

      public static final HttpHeaderName STRICT_TRANSPORT_SECURITY
      Strict-Transport-Security/strict-transport-security
    • TE

      public static final HttpHeaderName TE
      TE/te
    • TRAILER

      public static final HttpHeaderName TRAILER
      Trailer/trailer
    • TRANSFER_ENCODING

      public static final HttpHeaderName TRANSFER_ENCODING
      Transfer-Encoding/transfer-encoding
    • USER_AGENT

      public static final HttpHeaderName USER_AGENT
      User-Agent/user-agent
    • UPGRADE

      public static final HttpHeaderName UPGRADE
      Upgrade/upgrade
    • VARY

      public static final HttpHeaderName VARY
      Vary/vary
    • VIA

      public static final HttpHeaderName VIA
      Via/via
    • WARNING

      public static final HttpHeaderName WARNING
      Warning/warning
    • WWW_AUTHENTICATE

      public static final HttpHeaderName WWW_AUTHENTICATE
      WWW-Authenticate/www-authenticate
    • X_MS_CLIENT_ID

      public static final HttpHeaderName X_MS_CLIENT_ID
      x-ms-client-request-id
    • X_MS_CLIENT_REQUEST_ID

      public static final HttpHeaderName X_MS_CLIENT_REQUEST_ID
      x-ms-client-request-id
    • X_MS_DATE

      public static final HttpHeaderName X_MS_DATE
      x-ms-date
    • X_MS_REQUEST_ID

      public static final HttpHeaderName X_MS_REQUEST_ID
      x-ms-request-id
    • X_MS_RETRY_AFTER_MS

      public static final HttpHeaderName X_MS_RETRY_AFTER_MS
      x-ms-retry-after-ms
    • TRACEPARENT

      public static final HttpHeaderName TRACEPARENT
      traceparent
  • Constructor Details

  • Method Details

    • getCaseSensitiveName

      public String getCaseSensitiveName()
      Gets the HTTP header name based on the name passed into fromString(String).
      Returns:
      The HTTP header name based on the construction of this HttpHeaderName.
    • getCaseInsensitiveName

      public String getCaseInsensitiveName()
      Gets the HTTP header name lower cased.
      Returns:
      The HTTP header name lower cased.
    • fromString

      public static HttpHeaderName fromString(String name)
      Gets or creates the HttpHeaderName for the passed name.

      null will be returned if name is null.

      Parameters:
      name - The name.
      Returns:
      The HttpHeaderName of the passed name, or null if name was null.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ExpandableStringEnum<HttpHeaderName>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class ExpandableStringEnum<HttpHeaderName>