org.apache.hc.core5.http.nio.support

## Class AsyncRequestBuilder

- java.lang.Object
- - org.apache.hc.core5.http.support.AbstractMessageBuilder<T>
  - - org.apache.hc.core5.http.support.AbstractRequestBuilder<AsyncRequestProducer>
    - - org.apache.hc.core5.http.nio.support.AsyncRequestBuilder

-     public class AsyncRequestBuilder
      extends AbstractRequestBuilder<AsyncRequestProducer>

  Builder for `AsyncRequestProducer` instances.

  Please note that this class treats parameters differently depending on composition of the request: if the request has a content entity explicitly set with `setEntity(AsyncEntityProducer)` or it is not an entity enclosing method (such as POST or PUT), parameters will be added to the query component of the request URI. Otherwise, parameters will be added as a URL encoded entity.

  Since:
    5.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `AsyncRequestBuilder` | `addHeader(Header header)`
    `AsyncRequestBuilder` | `addHeader(String name, String value)`
    `AsyncRequestBuilder` | `addParameter(NameValuePair nvp)`
    `AsyncRequestBuilder` | `addParameter(String name, String value)`
    `AsyncRequestBuilder` | `addParameters(NameValuePair... nvps)`
    `AsyncRequestProducer` | `build()`
    `static AsyncRequestBuilder` | `create(String method)`
    `static AsyncRequestBuilder` | `delete()`
    `static AsyncRequestBuilder` | `delete(String uri)`
    `static AsyncRequestBuilder` | `delete(URI uri)`
    `static AsyncRequestBuilder` | `get()`
    `static AsyncRequestBuilder` | `get(String uri)`
    `static AsyncRequestBuilder` | `get(URI uri)`
    `AsyncEntityProducer` | `getEntity()`
    `static AsyncRequestBuilder` | `head()`
    `static AsyncRequestBuilder` | `head(String uri)`
    `static AsyncRequestBuilder` | `head(URI uri)`
    `static AsyncRequestBuilder` | `options()`
    `static AsyncRequestBuilder` | `options(String uri)`
    `static AsyncRequestBuilder` | `options(URI uri)`
    `static AsyncRequestBuilder` | `patch()`
    `static AsyncRequestBuilder` | `patch(String uri)`
    `static AsyncRequestBuilder` | `patch(URI uri)`
    `static AsyncRequestBuilder` | `post()`
    `static AsyncRequestBuilder` | `post(String uri)`
    `static AsyncRequestBuilder` | `post(URI uri)`
    `static AsyncRequestBuilder` | `put()`
    `static AsyncRequestBuilder` | `put(String uri)`
    `static AsyncRequestBuilder` | `put(URI uri)`
    `AsyncRequestBuilder` | `removeHeader(Header header)`
    `AsyncRequestBuilder` | `removeHeaders(String name)`
    `AsyncRequestBuilder` | `setAbsoluteRequestUri(boolean absoluteRequestUri)`
    `AsyncRequestBuilder` | `setAuthority(URIAuthority authority)`
    `AsyncRequestBuilder` | `setCharset(Charset charset)`
    `AsyncRequestBuilder` | `setEntity(AsyncEntityProducer entityProducer)`
    `AsyncRequestBuilder` | `setEntity(byte[] content, ContentType contentType)`
    `AsyncRequestBuilder` | `setEntity(String content)`
    `AsyncRequestBuilder` | `setEntity(String content, ContentType contentType)`
    `AsyncRequestBuilder` | `setHeader(Header header)`
    `AsyncRequestBuilder` | `setHeader(String name, String value)`
    `AsyncRequestBuilder` | `setHeaders(Header... headers)`
    `AsyncRequestBuilder` | `setHttpHost(HttpHost httpHost)`
    `AsyncRequestBuilder` | `setPath(String path)`
    `AsyncRequestBuilder` | `setScheme(String scheme)`
    `AsyncRequestBuilder` | `setUri(String uri)`
    `AsyncRequestBuilder` | `setUri(URI uri)`
    `AsyncRequestBuilder` | `setVersion(ProtocolVersion version)`
    `String` | `toString()`
    `static AsyncRequestBuilder` | `trace()`
    `static AsyncRequestBuilder` | `trace(String uri)`
    `static AsyncRequestBuilder` | `trace(URI uri)`

    - ### Methods inherited from class org.apache.hc.core5.http.support.AbstractRequestBuilder

      `digest, getAuthority, getCharset, getMethod, getParameters, getPath, getScheme, getUri, isAbsoluteRequestUri`

    - ### Methods inherited from class org.apache.hc.core5.http.support.AbstractMessageBuilder

      `digest, getFirstHeader, getFirstHeaders, getHeaders, getHeaders, getLastHeader, getVersion, setHeaders`

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

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

- - ### Method Detail

    - #### create

          public static AsyncRequestBuilder create(String method)

    - #### get

          public static AsyncRequestBuilder get()

    - #### get

          public static AsyncRequestBuilder get(URI uri)

    - #### get

          public static AsyncRequestBuilder get(String uri)

    - #### head

          public static AsyncRequestBuilder head()

    - #### head

          public static AsyncRequestBuilder head(URI uri)

    - #### head

          public static AsyncRequestBuilder head(String uri)

    - #### patch

          public static AsyncRequestBuilder patch()

    - #### patch

          public static AsyncRequestBuilder patch(URI uri)

    - #### patch

          public static AsyncRequestBuilder patch(String uri)

    - #### post

          public static AsyncRequestBuilder post()

    - #### post

          public static AsyncRequestBuilder post(URI uri)

    - #### post

          public static AsyncRequestBuilder post(String uri)

    - #### put

          public static AsyncRequestBuilder put()

    - #### put

          public static AsyncRequestBuilder put(URI uri)

    - #### put

          public static AsyncRequestBuilder put(String uri)

    - #### delete

          public static AsyncRequestBuilder delete()

    - #### delete

          public static AsyncRequestBuilder delete(URI uri)

    - #### delete

          public static AsyncRequestBuilder delete(String uri)

    - #### trace

          public static AsyncRequestBuilder trace()

    - #### trace

          public static AsyncRequestBuilder trace(URI uri)

    - #### trace

          public static AsyncRequestBuilder trace(String uri)

    - #### options

          public static AsyncRequestBuilder options()

    - #### options

          public static AsyncRequestBuilder options(URI uri)

    - #### options

          public static AsyncRequestBuilder options(String uri)

    - #### setVersion

          public AsyncRequestBuilder setVersion(ProtocolVersion version)

      Overrides:
        `setVersion` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setUri

          public AsyncRequestBuilder setUri(URI uri)

      Overrides:
        `setUri` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setUri

          public AsyncRequestBuilder setUri(String uri)

      Overrides:
        `setUri` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setScheme

          public AsyncRequestBuilder setScheme(String scheme)

      Overrides:
        `setScheme` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setAuthority

          public AsyncRequestBuilder setAuthority(URIAuthority authority)

      Overrides:
        `setAuthority` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setHttpHost

          public AsyncRequestBuilder setHttpHost(HttpHost httpHost)

      Overrides:
        `setHttpHost` in class `AbstractRequestBuilder<AsyncRequestProducer>`
      Since:
        5.1

    - #### setPath

          public AsyncRequestBuilder setPath(String path)

      Overrides:
        `setPath` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setHeaders

          public AsyncRequestBuilder setHeaders(Header... headers)

      Overrides:
        `setHeaders` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### addHeader

          public AsyncRequestBuilder addHeader(Header header)

      Overrides:
        `addHeader` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### addHeader

          public AsyncRequestBuilder addHeader(String name,
                                      String value)

      Overrides:
        `addHeader` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### removeHeader

          public AsyncRequestBuilder removeHeader(Header header)

      Overrides:
        `removeHeader` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### removeHeaders

          public AsyncRequestBuilder removeHeaders(String name)

      Overrides:
        `removeHeaders` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setHeader

          public AsyncRequestBuilder setHeader(Header header)

      Overrides:
        `setHeader` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setHeader

          public AsyncRequestBuilder setHeader(String name,
                                      String value)

      Overrides:
        `setHeader` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setCharset

          public AsyncRequestBuilder setCharset(Charset charset)

      Overrides:
        `setCharset` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### addParameter

          public AsyncRequestBuilder addParameter(NameValuePair nvp)

      Overrides:
        `addParameter` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### addParameter

          public AsyncRequestBuilder addParameter(String name,
                                         String value)

      Overrides:
        `addParameter` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### addParameters

          public AsyncRequestBuilder addParameters(NameValuePair... nvps)

      Overrides:
        `addParameters` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### setAbsoluteRequestUri

          public AsyncRequestBuilder setAbsoluteRequestUri(boolean absoluteRequestUri)

      Overrides:
        `setAbsoluteRequestUri` in class `AbstractRequestBuilder<AsyncRequestProducer>`

    - #### getEntity

          public AsyncEntityProducer getEntity()

    - #### setEntity

          public AsyncRequestBuilder setEntity(AsyncEntityProducer entityProducer)

    - #### setEntity

          public AsyncRequestBuilder setEntity(String content,
                                      ContentType contentType)

    - #### setEntity

          public AsyncRequestBuilder setEntity(String content)

    - #### setEntity

          public AsyncRequestBuilder setEntity(byte[] content,
                                      ContentType contentType)

    - #### build

          public AsyncRequestProducer build()

      Specified by:
        `build` in class `AbstractMessageBuilder<AsyncRequestProducer>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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