Enum HttpMethod

java.lang.Object
java.lang.Enum<HttpMethod>
com.linecorp.armeria.common.HttpMethod
All Implemented Interfaces:
Serializable, Comparable<HttpMethod>, java.lang.constant.Constable

public enum HttpMethod
extends Enum<HttpMethod>
HTTP request method.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants 
    Enum Constant Description
    CONNECT
    The CONNECT method which is used for a proxy that can dynamically switch to being a tunnel.
    DELETE
    The DELETE method which requests that the origin server delete the resource identified by the Request-URI.
    GET
    The GET method which means retrieve whatever information (in the form of an entity) is identified by the Request-URI.
    HEAD
    The HEAD method which is identical to GET except that the server MUST NOT return a message-body in the response.
    OPTIONS
    The OPTIONS method which represents a request for information about the communication options available on the request/response chain identified by the Request-URI.
    PATCH
    The PATCH method which requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI.
    POST
    The POST method which is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.
    PUT
    The PUT method which requests that the enclosed entity be stored under the supplied Request-URI.
    TRACE
    The TRACE method which is used to invoke a remote, application-layer loop-back of the request message.
    UNKNOWN
    A special method which represents the client sent a method that is none of the constants defined in this enum.
  • Method Summary

    Modifier and Type Method Description
    static Set<HttpMethod> idempotentMethods()
    Returns the idempotent HTTP methods - GET, HEAD, PUT and DELETE.
    static boolean isSupported​(String value)
    Returns whether the specified String is one of the supported method names.
    static Set<HttpMethod> knownMethods()
    Returns all HttpMethods except UNKNOWN.
    static HttpMethod valueOf​(String name)
    Returns the enum constant of this type with the specified name.
    static HttpMethod[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • OPTIONS

      public static final HttpMethod OPTIONS
      The OPTIONS method which represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.
    • GET

      public static final HttpMethod GET
      The GET method which means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process.
    • HEAD

      public static final HttpMethod HEAD
      The HEAD method which is identical to GET except that the server MUST NOT return a message-body in the response.
    • POST

      public static final HttpMethod POST
      The POST method which is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.
    • PUT

      public static final HttpMethod PUT
      The PUT method which requests that the enclosed entity be stored under the supplied Request-URI.
    • PATCH

      public static final HttpMethod PATCH
      The PATCH method which requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI.
    • DELETE

      public static final HttpMethod DELETE
      The DELETE method which requests that the origin server delete the resource identified by the Request-URI.
    • TRACE

      public static final HttpMethod TRACE
      The TRACE method which is used to invoke a remote, application-layer loop-back of the request message.
    • CONNECT

      public static final HttpMethod CONNECT
      The CONNECT method which is used for a proxy that can dynamically switch to being a tunnel.
    • UNKNOWN

      public static final HttpMethod UNKNOWN
      A special method which represents the client sent a method that is none of the constants defined in this enum.
  • Method Details

    • values

      public static HttpMethod[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static HttpMethod valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • isSupported

      public static boolean isSupported​(String value)
      Returns whether the specified String is one of the supported method names.
      Returns:
      true if supported. false otherwise.
    • idempotentMethods

      public static Set<HttpMethod> idempotentMethods()
      Returns the idempotent HTTP methods - GET, HEAD, PUT and DELETE.
    • knownMethods

      public static Set<HttpMethod> knownMethods()
      Returns all HttpMethods except UNKNOWN.