Package org.apache.hc.core5.net
Class WWWFormCodec
java.lang.Object
org.apache.hc.core5.net.WWWFormCodec
application/x-www-form-urlencoded
codec.- Since:
- 5.1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
format
(Iterable<? extends NameValuePair> params, Charset charset) Formats the list ofNameValuePair
parameters into aapplication/x-www-form-urlencoded
content string.static void
format
(StringBuilder buf, Iterable<? extends NameValuePair> params, Charset charset) Formats the list ofNameValuePair
parameters into aapplication/x-www-form-urlencoded
content.static List
<NameValuePair> parse
(CharSequence s, Charset charset) Returns a list ofNameValuePair
parameters parsed from theapplication/x-www-form-urlencoded
content.
-
Field Details
-
QP_SEP_A
private static final char QP_SEP_A- See Also:
-
-
Constructor Details
-
WWWFormCodec
public WWWFormCodec()
-
-
Method Details
-
parse
Returns a list ofNameValuePair
parameters parsed from theapplication/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 ofNameValuePair
parameters into aapplication/x-www-form-urlencoded
content.- Parameters:
buf
- the content bufferparams
- The from parameters.charset
- The encoding to use.
-
format
Formats the list ofNameValuePair
parameters into aapplication/x-www-form-urlencoded
content string.- Parameters:
params
- The from parameters.charset
- The encoding to use.- Returns:
- content string
-