Enum Class Method

java.lang.Object
java.lang.Enum<Method>
nl.colorize.util.http.Method
All Implemented Interfaces:
Serializable, Comparable<Method>, Constable

public enum Method extends Enum<Method>
HTTP request methods, as defined by the HTTP/1.1 standard. Refer to RFC 7231 for more information.
  • Enum Constant Details

    • GET

      public static final Method GET
    • POST

      public static final Method POST
    • PUT

      public static final Method PUT
    • DELETE

      public static final Method DELETE
    • CONNECT

      public static final Method CONNECT
    • OPTIONS

      public static final Method OPTIONS
    • TRACE

      public static final Method TRACE
  • Method Details

    • values

      public static Method[] 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 Method 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
    • hasRequestBody

      public boolean hasRequestBody()
      If true, HTTP requests using this method will send request parameters as part of the request body. Note that the specification does not forbid a request body to be present, but some web servers will ignore the request body if it's not "supposed" to be there.
    • isResponseHeadersOnly

      public boolean isResponseHeadersOnly()
      If true, HTTP requests using this method should only download the response headers, not the response body.
    • isSafe

      public boolean isSafe()
      Indicates that this request method is "safe" and intended for information retrieval without changing the state of the server.
    • parse

      public static Method parse(String methodName)
      Returns the Method instance corresponding to the HTTP request method with the specified name.
      Throws:
      IllegalArgumentException - if there is no matching request method.
      NullPointerException - if methodName is null.