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,HttpEntity
public class UrlEncodedFormEntity extends StringEntity
An entity composed of a list of url-encoded pairs.
This is typically useful while sending an HTTP POST request.
-
Field Summary
Fields inherited from class org.apache.http.entity.StringEntity
contentFields inherited from class org.apache.http.entity.AbstractHttpEntity
chunked, contentEncoding, contentType -
Constructor Summary
Constructors Constructor Description UrlEncodedFormEntity(List<? extends NameValuePair> parameters)Constructs a newUrlEncodedFormEntitywith the list of parameters with the default encoding ofHTTP.DEFAULT_CONTENT_CHARSETUrlEncodedFormEntity(List<? extends NameValuePair> parameters, String encoding)Constructs a newUrlEncodedFormEntitywith the list of parameters in the specified encoding. -
Method Summary
Methods inherited from class org.apache.http.entity.StringEntity
clone, getContent, getContentLength, isRepeatable, isStreaming, writeToMethods inherited from class org.apache.http.entity.AbstractHttpEntity
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType
-
Constructor Details
-
UrlEncodedFormEntity
public UrlEncodedFormEntity(List<? extends NameValuePair> parameters, String encoding) throws UnsupportedEncodingExceptionConstructs a newUrlEncodedFormEntitywith the list of parameters in the specified encoding.- Parameters:
parameters- list of name/value pairsencoding- encoding the name/value pairs be encoded with- Throws:
UnsupportedEncodingException- if the encoding isn't supported
-
UrlEncodedFormEntity
public UrlEncodedFormEntity(List<? extends NameValuePair> parameters) throws UnsupportedEncodingExceptionConstructs a newUrlEncodedFormEntitywith 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
-