Example usage for org.apache.http.client.entity UrlEncodedFormEntity setChunked

List of usage examples for org.apache.http.client.entity UrlEncodedFormEntity setChunked

Introduction

In this page you can find the example usage for org.apache.http.client.entity UrlEncodedFormEntity setChunked.

Prototype

public void setChunked(boolean z) 

Source Link

Usage

From source file:com.amazonaws.mws.MarketplaceWebServiceOrdersClient.java

/**
 * Add authentication related and version parameter and set request body
 * with all of the parameters/*from   w  w  w  . j  av a  2 s .  c o m*/
 * @throws SignatureException 
 * @throws UnsupportedEncodingException 
 */
private UrlEncodedFormEntity createEntity(Map<String, String> parameters)
        throws SignatureException, UnsupportedEncodingException {
    addRequiredParameters(parameters);
    List<NameValuePair> nvpl = new ArrayList<NameValuePair>();

    for (Entry<String, String> entry : parameters.entrySet()) {
        String key = entry.getKey() == null ? "" : entry.getKey();
        String value = entry.getValue() == null ? "" : entry.getValue();
        nvpl.add(new BasicNameValuePair(key, value));
    }

    UrlEncodedFormEntity ret = new UrlEncodedFormEntity(nvpl);

    ret.setChunked(true);

    return ret;
}