org.apache.hc.client5.http.entity

## 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

    Constructors
    Constructor and Description
    `UrlEncodedFormEntity(Iterable<? extends org.apache.hc.core5.http.NameValuePair> parameters)` Constructs a new `UrlEncodedFormEntity` with the list of parameters with the default encoding of `ContentType.APPLICATION_FORM_URLENCODED`
    `UrlEncodedFormEntity(Iterable<? extends org.apache.hc.core5.http.NameValuePair> parameters, Charset charset)` Constructs a new `UrlEncodedFormEntity` with the list of parameters in the specified encoding.
    `UrlEncodedFormEntity(List<? extends org.apache.hc.core5.http.NameValuePair> parameters)` Constructs a new `UrlEncodedFormEntity` with the list of parameters with the default encoding of `ContentType.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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### UrlEncodedFormEntity

          public UrlEncodedFormEntity(Iterable<? extends org.apache.hc.core5.http.NameValuePair> parameters,
                                      Charset charset)

      Constructs a new `UrlEncodedFormEntity` with the list of parameters in the specified encoding.
      Parameters:
        `parameters` - iterable collection of name/value pairs
        `charset` - encoding the name/value pairs be encoded with
      Since:
        4.2

    - #### UrlEncodedFormEntity

          public UrlEncodedFormEntity(List<? extends org.apache.hc.core5.http.NameValuePair> parameters)

      Constructs a new `UrlEncodedFormEntity` with the list of parameters with the default encoding of `ContentType.APPLICATION_FORM_URLENCODED`
      Parameters:
        `parameters` - list of name/value pairs

    - #### UrlEncodedFormEntity

          public UrlEncodedFormEntity(Iterable<? extends org.apache.hc.core5.http.NameValuePair> parameters)

      Constructs a new `UrlEncodedFormEntity` with the list of parameters with the default encoding of `ContentType.APPLICATION_FORM_URLENCODED`
      Parameters:
        `parameters` - iterable collection of name/value pairs
      Since:
        4.2

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.