Class WWWFormCodec


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

      Fields 
      Modifier and Type Field Description
      private static char QP_SEP_A  
    • Constructor Summary

      Constructors 
      Constructor Description
      WWWFormCodec()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.lang.Iterable<? extends NameValuePair> params, java.nio.charset.Charset charset)
      Formats the list of NameValuePair parameters into a application/x-www-form-urlencoded content string.
      static void format​(java.lang.StringBuilder buf, java.lang.Iterable<? extends NameValuePair> params, java.nio.charset.Charset charset)
      Formats the list of NameValuePair parameters into a application/x-www-form-urlencoded content.
      static java.util.List<NameValuePair> parse​(java.lang.CharSequence s, java.nio.charset.Charset charset)
      Returns a list of NameValuePair parameters parsed from the application/x-www-form-urlencoded content.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WWWFormCodec

        public WWWFormCodec()
    • Method Detail

      • parse

        public static java.util.List<NameValuePair> parse​(java.lang.CharSequence s,
                                                          java.nio.charset.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​(java.lang.StringBuilder buf,
                                  java.lang.Iterable<? extends NameValuePair> params,
                                  java.nio.charset.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 java.lang.String format​(java.lang.Iterable<? extends NameValuePair> params,
                                              java.nio.charset.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