org.apache.hc.client5.http.async.methods

## Class SimpleRequestBuilder

- java.lang.Object
- - org.apache.hc.core5.http.support.AbstractMessageBuilder<T>
  - - org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>
    - - org.apache.hc.client5.http.async.methods.SimpleRequestBuilder

-     public class SimpleRequestBuilder
      extends AbstractRequestBuilder<SimpleHttpRequest>

  Builder for `SimpleHttpRequest` 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 `setBody(SimpleBody)` 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

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SimpleRequestBuilder` | `addHeader(Header header)`
    `SimpleRequestBuilder` | `addHeader(String name, String value)`
    `SimpleRequestBuilder` | `addParameter(NameValuePair nvp)`
    `SimpleRequestBuilder` | `addParameter(String name, String value)`
    `SimpleRequestBuilder` | `addParameters(NameValuePair... nvps)`
    `SimpleHttpRequest` | `build()`
    `static SimpleRequestBuilder` | `copy(HttpRequest request)`
    `static SimpleRequestBuilder` | `copy(SimpleHttpRequest request)`
    `static SimpleRequestBuilder` | `create(Method method)`
    `static SimpleRequestBuilder` | `create(String method)`
    `static SimpleRequestBuilder` | `delete()`
    `static SimpleRequestBuilder` | `delete(String uri)`
    `static SimpleRequestBuilder` | `delete(URI uri)`
    `protected void` | `digest(HttpRequest request)`
    `protected void` | `digest(SimpleHttpRequest request)`
    `static SimpleRequestBuilder` | `get()`
    `static SimpleRequestBuilder` | `get(String uri)`
    `static SimpleRequestBuilder` | `get(URI uri)`
    `SimpleBody` | `getBody()`
    `RequestConfig` | `getRequestConfig()`
    `static SimpleRequestBuilder` | `head()`
    `static SimpleRequestBuilder` | `head(String uri)`
    `static SimpleRequestBuilder` | `head(URI uri)`
    `static SimpleRequestBuilder` | `options()`
    `static SimpleRequestBuilder` | `options(String uri)`
    `static SimpleRequestBuilder` | `options(URI uri)`
    `static SimpleRequestBuilder` | `patch()`
    `static SimpleRequestBuilder` | `patch(String uri)`
    `static SimpleRequestBuilder` | `patch(URI uri)`
    `static SimpleRequestBuilder` | `post()`
    `static SimpleRequestBuilder` | `post(String uri)`
    `static SimpleRequestBuilder` | `post(URI uri)`
    `static SimpleRequestBuilder` | `put()`
    `static SimpleRequestBuilder` | `put(String uri)`
    `static SimpleRequestBuilder` | `put(URI uri)`
    `SimpleRequestBuilder` | `removeHeader(Header header)`
    `SimpleRequestBuilder` | `removeHeaders(String name)`
    `SimpleRequestBuilder` | `setAbsoluteRequestUri(boolean absoluteRequestUri)`
    `SimpleRequestBuilder` | `setAuthority(URIAuthority authority)`
    `SimpleRequestBuilder` | `setBody(byte[] content, ContentType contentType)`
    `SimpleRequestBuilder` | `setBody(SimpleBody body)`
    `SimpleRequestBuilder` | `setBody(String content, ContentType contentType)`
    `SimpleRequestBuilder` | `setCharset(Charset charset)`
    `SimpleRequestBuilder` | `setHeader(Header header)`
    `SimpleRequestBuilder` | `setHeader(String name, String value)`
    `SimpleRequestBuilder` | `setHeaders(Header... headers)`
    `SimpleRequestBuilder` | `setHttpHost(HttpHost httpHost)`
    `SimpleRequestBuilder` | `setPath(String path)`
    `SimpleRequestBuilder` | `setRequestConfig(RequestConfig requestConfig)`
    `SimpleRequestBuilder` | `setScheme(String scheme)`
    `SimpleRequestBuilder` | `setUri(String uri)`
    `SimpleRequestBuilder` | `setUri(URI uri)`
    `SimpleRequestBuilder` | `setVersion(ProtocolVersion version)`
    `String` | `toString()`
    `static SimpleRequestBuilder` | `trace()`
    `static SimpleRequestBuilder` | `trace(String uri)`
    `static SimpleRequestBuilder` | `trace(URI uri)`

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

      `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 SimpleRequestBuilder create(String method)

    - #### create

          public static SimpleRequestBuilder create(Method method)

    - #### get

          public static SimpleRequestBuilder get()

    - #### get

          public static SimpleRequestBuilder get(URI uri)

    - #### get

          public static SimpleRequestBuilder get(String uri)

    - #### head

          public static SimpleRequestBuilder head()

    - #### head

          public static SimpleRequestBuilder head(URI uri)

    - #### head

          public static SimpleRequestBuilder head(String uri)

    - #### patch

          public static SimpleRequestBuilder patch()

    - #### patch

          public static SimpleRequestBuilder patch(URI uri)

    - #### patch

          public static SimpleRequestBuilder patch(String uri)

    - #### post

          public static SimpleRequestBuilder post()

    - #### post

          public static SimpleRequestBuilder post(URI uri)

    - #### post

          public static SimpleRequestBuilder post(String uri)

    - #### put

          public static SimpleRequestBuilder put()

    - #### put

          public static SimpleRequestBuilder put(URI uri)

    - #### put

          public static SimpleRequestBuilder put(String uri)

    - #### delete

          public static SimpleRequestBuilder delete()

    - #### delete

          public static SimpleRequestBuilder delete(URI uri)

    - #### delete

          public static SimpleRequestBuilder delete(String uri)

    - #### trace

          public static SimpleRequestBuilder trace()

    - #### trace

          public static SimpleRequestBuilder trace(URI uri)

    - #### trace

          public static SimpleRequestBuilder trace(String uri)

    - #### options

          public static SimpleRequestBuilder options()

    - #### options

          public static SimpleRequestBuilder options(URI uri)

    - #### options

          public static SimpleRequestBuilder options(String uri)

    - #### copy

          public static SimpleRequestBuilder copy(SimpleHttpRequest request)

      Since:
        5.1

    - #### copy

          public static SimpleRequestBuilder copy(HttpRequest request)

      Since:
        5.1

    - #### digest

          protected void digest(SimpleHttpRequest request)

    - #### digest

          protected void digest(HttpRequest request)

      Overrides:
        `digest` in class `AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setVersion

          public SimpleRequestBuilder setVersion(ProtocolVersion version)

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

    - #### setUri

          public SimpleRequestBuilder setUri(URI uri)

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

    - #### setUri

          public SimpleRequestBuilder setUri(String uri)

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

    - #### setScheme

          public SimpleRequestBuilder setScheme(String scheme)

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

    - #### setAuthority

          public SimpleRequestBuilder setAuthority(URIAuthority authority)

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

    - #### setHttpHost

          public SimpleRequestBuilder setHttpHost(HttpHost httpHost)

      Overrides:
        `setHttpHost` in class `AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setPath

          public SimpleRequestBuilder setPath(String path)

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

    - #### setHeaders

          public SimpleRequestBuilder setHeaders(Header... headers)

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

    - #### addHeader

          public SimpleRequestBuilder addHeader(Header header)

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

    - #### addHeader

          public SimpleRequestBuilder addHeader(String name,
                                                String value)

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

    - #### removeHeader

          public SimpleRequestBuilder removeHeader(Header header)

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

    - #### removeHeaders

          public SimpleRequestBuilder removeHeaders(String name)

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

    - #### setHeader

          public SimpleRequestBuilder setHeader(Header header)

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

    - #### setHeader

          public SimpleRequestBuilder setHeader(String name,
                                                String value)

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

    - #### setCharset

          public SimpleRequestBuilder setCharset(Charset charset)

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

    - #### addParameter

          public SimpleRequestBuilder addParameter(NameValuePair nvp)

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

    - #### addParameter

          public SimpleRequestBuilder addParameter(String name,
                                                   String value)

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

    - #### addParameters

          public SimpleRequestBuilder addParameters(NameValuePair... nvps)

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

    - #### setAbsoluteRequestUri

          public SimpleRequestBuilder setAbsoluteRequestUri(boolean absoluteRequestUri)

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

    - #### getBody

          public SimpleBody getBody()

    - #### setBody

          public SimpleRequestBuilder setBody(SimpleBody body)

    - #### setBody

          public SimpleRequestBuilder setBody(String content,
                                              ContentType contentType)

    - #### setBody

          public SimpleRequestBuilder setBody(byte[] content,
                                              ContentType contentType)

    - #### getRequestConfig

          public RequestConfig getRequestConfig()

    - #### setRequestConfig

          public SimpleRequestBuilder setRequestConfig(RequestConfig requestConfig)

    - #### build

          public SimpleHttpRequest build()

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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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