HttpHeaderName Class

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<T>, so it can be used in the same way as other expandable string enums. For example, you can use the fromString(String name) method to get an instance of this class from a string.

Field Summary

Modifier and Type Field and Description
static final HttpHeaderName ACCEPT

Accept/accept

static final HttpHeaderName ACCEPT_CHARSET

Accept-Charset/accept-charset

static final HttpHeaderName ACCEPT_DATETIME

Accept-Datetime/accept-datetime

static final HttpHeaderName ACCEPT_ENCODING

Accept-Encoding/accept-encoding

static final HttpHeaderName ACCEPT_LANGUAGE

Accept-Language/accept-language

static final HttpHeaderName ACCEPT_PATCH

Accept-Patch/accept-patch

static final HttpHeaderName ACCEPT_RANGES

Accept-Ranges/accept-ranges

static final HttpHeaderName ACCESS_CONTROL_ALLOW_CREDENTIALS

Access-Control-Allow-Credentials/access-control-allow-credentials

static final HttpHeaderName ACCESS_CONTROL_ALLOW_HEADERS

Access-Control-Allow-Headers/access-control-allow-headers

static final HttpHeaderName ACCESS_CONTROL_ALLOW_METHODS

Access-Control-Allow-Methods/access-control-allow-methods

static final HttpHeaderName ACCESS_CONTROL_ALLOW_ORIGIN

Access-Control-Allow-Origin/access-control-allow-origin

static final HttpHeaderName ACCESS_CONTROL_EXPOSE_HEADERS

Access-Control-Expose-Headers/access-control-expose-headers

static final HttpHeaderName ACCESS_CONTROL_MAX_AGE

Access-Control-Max-Age/access-control-max-age

static final HttpHeaderName AGE

Age/age

static final HttpHeaderName ALLOW

Allow/allow

static final HttpHeaderName AUTHORIZATION

Authorization/authorization

static final HttpHeaderName AZURE_ASYNCOPERATION

Azure-AsyncOperation/azure-azyncoperation

static final HttpHeaderName CACHE_CONTROL

Cache-Control/cache-control

static final HttpHeaderName CONNECTION

Connection/connection

static final HttpHeaderName CONTENT_DISPOSITION

Content-Disposition/content-disposition

static final HttpHeaderName CONTENT_ENCODING

Content-Encoding/content-encoding

static final HttpHeaderName CONTENT_LANGUAGE

Content-Language/content-language

static final HttpHeaderName CONTENT_LENGTH

Content-Length/content-length

static final HttpHeaderName CONTENT_LOCATION

Content-Location/content-location

static final HttpHeaderName CONTENT_MD5

Content-MD5/content-md5

static final HttpHeaderName CONTENT_RANGE

Content-Range/content-range

static final HttpHeaderName CONTENT_TYPE

Content-Type/content-type

static final HttpHeaderName COOKIE

Cookie/cookie

static final HttpHeaderName DATE

Date/date

static final HttpHeaderName ETAG

ETag/etag

static final HttpHeaderName EXPECT

Expect/expect

static final HttpHeaderName EXPIRES

Expires/expires

static final HttpHeaderName FORWARDED

Forwarded/forwarded

static final HttpHeaderName FROM

From/from

static final HttpHeaderName HOST

Host/host

static final HttpHeaderName HTTP2_SETTINGS

HTTP2-Settings/http2-settings

static final HttpHeaderName IF_MATCH

If-Match/if-match

static final HttpHeaderName IF_MODIFIED_SINCE

If-Modified-Since/if-modified-since

static final HttpHeaderName IF_NONE_MATCH

If-None-Match/if-none-match

static final HttpHeaderName IF_RANGE

If-Range/if-range

static final HttpHeaderName IF_UNMODIFIED_SINCE

If-Unmodified-Since/if-unmodified-since

static final HttpHeaderName LAST_MODIFIED

Last-Modified/last-modified

static final HttpHeaderName LINK

Link/link

static final HttpHeaderName LOCATION

Location/location

static final HttpHeaderName MAX_FORWARDS

Max-Forwards/max-forwards

static final HttpHeaderName OPERATION_LOCATION

Operation-Location/operation-location

static final HttpHeaderName ORIGIN

Origin/origin

static final HttpHeaderName PRAGMA

Pragma/pragma

static final HttpHeaderName PREFER

Prefer/prefer

static final HttpHeaderName PREFERENCE_APPLIED

Preference-Applied/preference-applied

static final HttpHeaderName PROXY_AUTHENTICATE

Proxy-Authenticate/proxy-authenticate

static final HttpHeaderName PROXY_AUTHORIZATION

Proxy-Authorization/proxy-authorization

static final HttpHeaderName RANGE

Range/range

static final HttpHeaderName REFERER

Referer/referer

static final HttpHeaderName RETRY_AFTER

Retry-After/retry-after

static final HttpHeaderName RETRY_AFTER_MS

retry-after-ms

static final HttpHeaderName SERVER

Server/server

static final HttpHeaderName SET_COOKIE

Set-Cookie/set-cookie

static final HttpHeaderName STRICT_TRANSPORT_SECURITY

Strict-Transport-Security/strict-transport-security

static final HttpHeaderName TE

TE/te

static final HttpHeaderName TRACEPARENT

traceparent

static final HttpHeaderName TRAILER

Trailer/trailer

static final HttpHeaderName TRANSFER_ENCODING

Transfer-Encoding/transfer-encoding

static final HttpHeaderName UPGRADE

Upgrade/upgrade

static final HttpHeaderName USER_AGENT

User-Agent/user-agent

static final HttpHeaderName VARY

Vary/vary

static final HttpHeaderName VIA

Via/via

static final HttpHeaderName WARNING

Warning/warning

static final HttpHeaderName WWW_AUTHENTICATE

WWW-Authenticate/www-authenticate

static final HttpHeaderName X_MS_CLIENT_ID

x-ms-client-request-id

static final HttpHeaderName X_MS_CLIENT_REQUEST_ID

x-ms-client-request-id

static final HttpHeaderName X_MS_DATE

x-ms-date

static final HttpHeaderName X_MS_REQUEST_ID

x-ms-request-id

static final HttpHeaderName X_MS_RETRY_AFTER_MS

x-ms-retry-after-ms

Constructor Summary

Constructor Description
HttpHeaderName()

Deprecated

Use one of the constants or the fromString(String name) factory method.

Creates a new instance of HttpHeaderName without a #toString() value.

Method Summary

Modifier and Type Method and Description
boolean equals(Object obj)
static HttpHeaderName fromString(String name)

Gets or creates the HttpHeaderName for the passed name.

String getCaseInsensitiveName()

Gets the HTTP header name lower cased.

String getCaseSensitiveName()

Gets the HTTP header name based on the name passed into fromString(String name).

int hashCode()

Methods inherited from ExpandableStringEnum

Methods inherited from java.lang.Object

Field Details

ACCEPT

public static final HttpHeaderName ACCEPT

Accept/accept

ACCEPT_CHARSET

public static final HttpHeaderName ACCEPT_CHARSET

Accept-Charset/accept-charset

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

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

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

public static final HttpHeaderName COOKIE

Cookie/cookie

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

public static final HttpHeaderName LINK

Link/link

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

public static final HttpHeaderName SET_COOKIE

Set-Cookie/set-cookie

STRICT_TRANSPORT_SECURITY

public static final HttpHeaderName STRICT_TRANSPORT_SECURITY

Strict-Transport-Security/strict-transport-security

TE

public static final HttpHeaderName TE

TE/te

TRACEPARENT

public static final HttpHeaderName TRACEPARENT

traceparent

TRAILER

public static final HttpHeaderName TRAILER

Trailer/trailer

TRANSFER_ENCODING

public static final HttpHeaderName TRANSFER_ENCODING

Transfer-Encoding/transfer-encoding

UPGRADE

public static final HttpHeaderName UPGRADE

Upgrade/upgrade

USER_AGENT

public static final HttpHeaderName USER_AGENT

User-Agent/user-agent

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

Constructor Details

HttpHeaderName

@Deprecated
public HttpHeaderName()

Deprecated

Use one of the constants or the fromString(String name) factory method.

Creates a new instance of HttpHeaderName without a #toString() value.

This constructor shouldn't be called as it will produce a HttpHeaderName which doesn't have a String enum value.

Method Details

equals

public boolean equals(Object obj)

Overrides:

HttpHeaderName.equals(Object obj)

Parameters:

obj

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.

getCaseInsensitiveName

public String getCaseInsensitiveName()

Gets the HTTP header name lower cased.

Returns:

The HTTP header name lower cased.

getCaseSensitiveName

public String getCaseSensitiveName()

Gets the HTTP header name based on the name passed into fromString(String name).

Returns:

The HTTP header name based on the construction of this HttpHeaderName.

hashCode

public int hashCode()

Overrides:

HttpHeaderName.hashCode()

Applies to