Class HttpMethod

java.lang.Object
org.microproxy.http.HttpMethod

public final class HttpMethod extends Object
An HTTP request method. Well-known methods are interned, so == works for them.
  • Field Details

    • GET

      public static final HttpMethod GET
      The GET request method.
    • POST

      public static final HttpMethod POST
      The POST request method.
    • PUT

      public static final HttpMethod PUT
      The PUT request method.
    • DELETE

      public static final HttpMethod DELETE
      The DELETE request method.
    • CONNECT

      public static final HttpMethod CONNECT
      The CONNECT request method.
    • OPTIONS

      public static final HttpMethod OPTIONS
      The OPTIONS request method.
    • TRACE

      public static final HttpMethod TRACE
      The TRACE request method.
    • PATCH

      public static final HttpMethod PATCH
      The PATCH request method.
  • Method Details

    • valueOf

      public static HttpMethod valueOf(String name)
      Returns the method with the given (case-sensitive) name.
      Parameters:
      name - method token
      Returns:
      the interned well-known method or a new extension method
      Throws:
      IllegalArgumentException - if the name is not a valid HTTP token
    • name

      public String name()
      Returns the case-sensitive method name.
      Returns:
      the case-sensitive method name
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object