Enum Class QueryFormat

All Implemented Interfaces:
Serializable, Comparable<QueryFormat>, Constable

public enum QueryFormat extends Enum<QueryFormat>
Strategies for encoding/decoding query strings: Content-Type: application/x-www-form-urlencoded (supports "+" for spaces) or "strict" RFC 3986 (percent-decoding only).
Author:
Mark Allen
See Also:
  • Enum Constant Details

    • X_WWW_FORM_URLENCODED

      public static final QueryFormat X_WWW_FORM_URLENCODED
      Follow RFC 1866 (the application/x-www-form-urlencoded content type), where keys and values are percent-encoded but prefer "+" for spaces.

      Note that "%20" values are still decoded as spaces, but any "+" values are decoded as spaces first.

    • RFC_3986_STRICT

      public static final QueryFormat RFC_3986_STRICT
      Follow RFC 3986, where keys and values are percent-encoded and "+" values are never decoded as spaces.
  • Method Details

    • values

      public static QueryFormat[] 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 QueryFormat 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