org.apache.hc.core5.net

## 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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WWWFormCodec()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `format(Iterable<? extends NameValuePair> params, Charset charset)` Formats the list of `NameValuePair` parameters into a `application/x-www-form-urlencoded` content string.
    `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.
    `static List<NameValuePair>` | `parse(CharSequence s, 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 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

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.