Enum Class HttpMethod

java.lang.Object
java.lang.Enum<HttpMethod>
org.seppiko.commons.utils.http.HttpMethod
All Implemented Interfaces:
Serializable, Comparable<HttpMethod>, Constable

public enum HttpMethod extends Enum<HttpMethod>
Http methods
Author:
Leonard Woo
See Also:
  • 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
    The CONNECT method establishes a tunnel to the server identified by the target resource.
    The DELETE method deletes the specified resource.
    The GET method requests a representation of the specified resource.
    The HEAD method asks for a response identical to a GET request, but without the response body.
    The OPTIONS method describes the communication options for the target resource.
    The PATCH method applies partial modifications to a resource.
    The POST method submits an entity to the specified resource, often causing a change in state or side effects on the server.
    The PUT method replaces all current representations of the target resource with the request payload.
    The TRACE method performs a message loop-back test along the path to the target resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    static HttpMethod
    Return an HttpMethod object for the given value.
    static HttpMethod
    Returns the enum constant of this class with the specified name.
    static HttpMethod[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

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

    • GET

      public static final HttpMethod GET
      The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
    • POST

      public static final HttpMethod POST
      The POST method submits an entity to the specified resource, often causing a change in state or side effects on the server.
    • PUT

      public static final HttpMethod PUT
      The PUT method replaces all current representations of the target resource with the request payload.
    • DELETE

      public static final HttpMethod DELETE
      The DELETE method deletes the specified resource.
    • OPTIONS

      public static final HttpMethod OPTIONS
      The OPTIONS method describes the communication options for the target resource.
    • CONNECT

      public static final HttpMethod CONNECT
      The CONNECT method establishes a tunnel to the server identified by the target resource.
    • TRACE

      public static final HttpMethod TRACE
      The TRACE method performs a message loop-back test along the path to the target resource.
    • PATCH

      public static final HttpMethod PATCH
      The PATCH method applies partial modifications to a resource.
  • Method Details

    • values

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

      public static HttpMethod valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • resolve

      public static HttpMethod resolve(String name) throws NullPointerException
      Return an HttpMethod object for the given value.
      Parameters:
      name - the method value as a String.
      Returns:
      the corresponding HttpMethod, or null if not found
      Throws:
      NullPointerException - method name is null.