Package org.apache.http.client.entity
Class UrlEncodedFormEntity
java.lang.Object
org.apache.http.entity.AbstractHttpEntity
org.apache.http.entity.StringEntity
org.apache.http.client.entity.UrlEncodedFormEntity
- All Implemented Interfaces:
Cloneable
,org.apache.http.HttpEntity
public class UrlEncodedFormEntity
extends org.apache.http.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
-
Field Summary
Fields inherited from class org.apache.http.entity.StringEntity
content
Fields inherited from class org.apache.http.entity.AbstractHttpEntity
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionUrlEncodedFormEntity
(Iterable<? extends org.apache.http.NameValuePair> parameters) Constructs a newUrlEncodedFormEntity
with the list of parameters with the default encoding ofHTTP.DEFAULT_CONTENT_CHARSET
UrlEncodedFormEntity
(Iterable<? extends org.apache.http.NameValuePair> parameters, Charset charset) Constructs a newUrlEncodedFormEntity
with the list of parameters in the specified encoding.UrlEncodedFormEntity
(List<? extends org.apache.http.NameValuePair> parameters) Constructs a newUrlEncodedFormEntity
with the list of parameters with the default encoding ofHTTP.DEFAULT_CONTENT_CHARSET
UrlEncodedFormEntity
(List<? extends org.apache.http.NameValuePair> parameters, String charset) Constructs a newUrlEncodedFormEntity
with the list of parameters in the specified encoding. -
Method Summary
Methods inherited from class org.apache.http.entity.StringEntity
clone, getContent, getContentLength, isRepeatable, isStreaming, writeTo
Methods inherited from class org.apache.http.entity.AbstractHttpEntity
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType, toString
-
Constructor Details
-
UrlEncodedFormEntity
public UrlEncodedFormEntity(List<? extends org.apache.http.NameValuePair> parameters, String charset) throws UnsupportedEncodingException Constructs a newUrlEncodedFormEntity
with the list of parameters in the specified encoding.- Parameters:
parameters
- list of name/value pairscharset
- encoding the name/value pairs be encoded with- Throws:
UnsupportedEncodingException
- if the encoding isn't supported
-
UrlEncodedFormEntity
public UrlEncodedFormEntity(Iterable<? extends org.apache.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
public UrlEncodedFormEntity(List<? extends org.apache.http.NameValuePair> parameters) throws UnsupportedEncodingException Constructs a newUrlEncodedFormEntity
with the list of parameters with the default encoding ofHTTP.DEFAULT_CONTENT_CHARSET
- Parameters:
parameters
- list of name/value pairs- Throws:
UnsupportedEncodingException
- if the default encoding isn't supported
-
UrlEncodedFormEntity
Constructs a newUrlEncodedFormEntity
with the list of parameters with the default encoding ofHTTP.DEFAULT_CONTENT_CHARSET
- Parameters:
parameters
- iterable collection of name/value pairs- Since:
- 4.2
-