Class UrlEncodedFormEntity
java.lang.Object
org.apache.hc.core5.http.io.entity.AbstractHttpEntity
org.apache.hc.core5.http.io.entity.StringEntity
org.apache.hc.client5.http.entity.UrlEncodedFormEntity
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.hc.core5.http.EntityDetails
,org.apache.hc.core5.http.HttpEntity
public class UrlEncodedFormEntity
extends org.apache.hc.core5.http.io.entity.StringEntity
An entity composed of a list of url-encoded pairs.
This is typically useful while sending an HTTP POST request.
- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionUrlEncodedFormEntity
(Iterable<? extends org.apache.hc.core5.http.NameValuePair> parameters) Constructs a newUrlEncodedFormEntity
with the list of parameters with the default encoding ofContentType.APPLICATION_FORM_URLENCODED
UrlEncodedFormEntity
(Iterable<? extends org.apache.hc.core5.http.NameValuePair> parameters, Charset charset) Constructs a newUrlEncodedFormEntity
with the list of parameters in the specified encoding.UrlEncodedFormEntity
(List<? extends org.apache.hc.core5.http.NameValuePair> parameters) Constructs a newUrlEncodedFormEntity
with the list of parameters with the default encoding ofContentType.APPLICATION_FORM_URLENCODED
-
Method Summary
Methods inherited from class org.apache.hc.core5.http.io.entity.StringEntity
close, getContent, getContentLength, isRepeatable, isStreaming, writeTo
Methods inherited from class org.apache.hc.core5.http.io.entity.AbstractHttpEntity
getContentEncoding, getContentType, getTrailerNames, getTrailers, isChunked, toString, writeTo
-
Constructor Details
-
UrlEncodedFormEntity
public UrlEncodedFormEntity(Iterable<? extends org.apache.hc.core5.http.NameValuePair> parameters, Charset charset) Constructs a newUrlEncodedFormEntity
with the list of parameters in the specified encoding.- Parameters:
parameters
- iterable collection of name/value pairscharset
- encoding the name/value pairs be encoded with- Since:
- 4.2
-
UrlEncodedFormEntity
Constructs a newUrlEncodedFormEntity
with the list of parameters with the default encoding ofContentType.APPLICATION_FORM_URLENCODED
- Parameters:
parameters
- list of name/value pairs
-
UrlEncodedFormEntity
Constructs a newUrlEncodedFormEntity
with the list of parameters with the default encoding ofContentType.APPLICATION_FORM_URLENCODED
- Parameters:
parameters
- iterable collection of name/value pairs- Since:
- 4.2
-