Class WWWFormCodec

java.lang.Object
org.apache.hc.core5.net.WWWFormCodec

public class WWWFormCodec extends Object
application/x-www-form-urlencoded codec.
Since:
5.1
  • Field Details

  • Constructor Details

    • WWWFormCodec

      public WWWFormCodec()
  • Method Details

    • parse

      public static List<NameValuePair> parse(CharSequence s, Charset charset)
      Returns a list of NameValuePair parameters parsed from the application/x-www-form-urlencoded content.
      Parameters:
      s - input text.
      charset - parameter charset.
      Returns:
      list of form parameters.
    • format

      public static void format(StringBuilder buf, Iterable<? extends NameValuePair> params, Charset charset)
      Formats the list of NameValuePair parameters into a application/x-www-form-urlencoded content.
      Parameters:
      buf - the content buffer
      params - The from parameters.
      charset - The encoding to use.
    • format

      public static String format(Iterable<? extends NameValuePair> params, Charset charset)
      Formats the list of NameValuePair parameters into a application/x-www-form-urlencoded content string.
      Parameters:
      params - The from parameters.
      charset - The encoding to use.
      Returns:
      content string