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 org.apache.hc.core5.http.support.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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SimpleRequestBuilder` | `addHeader(org.apache.hc.core5.http.Header header)`
    `SimpleRequestBuilder` | `addHeader(String name, String value)`
    `SimpleRequestBuilder` | `addParameter(org.apache.hc.core5.http.NameValuePair nvp)`
    `SimpleRequestBuilder` | `addParameter(String name, String value)`
    `SimpleRequestBuilder` | `addParameters(org.apache.hc.core5.http.NameValuePair... nvps)`
    `SimpleHttpRequest` | `build()`
    `static SimpleRequestBuilder` | `copy(org.apache.hc.core5.http.HttpRequest request)`
    `static SimpleRequestBuilder` | `copy(SimpleHttpRequest request)`
    `static SimpleRequestBuilder` | `create(org.apache.hc.core5.http.Method method)`
    `static SimpleRequestBuilder` | `create(String method)`
    `static SimpleRequestBuilder` | `delete()`
    `static SimpleRequestBuilder` | `delete(String uri)`
    `static SimpleRequestBuilder` | `delete(URI uri)`
    `protected void` | `digest(org.apache.hc.core5.http.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(org.apache.hc.core5.http.Header header)`
    `SimpleRequestBuilder` | `removeHeaders(String name)`
    `SimpleRequestBuilder` | `setAbsoluteRequestUri(boolean absoluteRequestUri)`
    `SimpleRequestBuilder` | `setAuthority(org.apache.hc.core5.net.URIAuthority authority)`
    `SimpleRequestBuilder` | `setBody(byte[] content, org.apache.hc.core5.http.ContentType contentType)`
    `SimpleRequestBuilder` | `setBody(SimpleBody body)`
    `SimpleRequestBuilder` | `setBody(String content, org.apache.hc.core5.http.ContentType contentType)`
    `SimpleRequestBuilder` | `setCharset(Charset charset)`
    `SimpleRequestBuilder` | `setHeader(org.apache.hc.core5.http.Header header)`
    `SimpleRequestBuilder` | `setHeader(String name, String value)`
    `SimpleRequestBuilder` | `setHeaders(org.apache.hc.core5.http.Header... headers)`
    `SimpleRequestBuilder` | `setHttpHost(org.apache.hc.core5.http.HttpHost httpHost)`
    `SimpleRequestBuilder` | `setPath(String path)`
    `SimpleRequestBuilder` | `setRequestConfig(RequestConfig requestConfig)`
    `SimpleRequestBuilder` | `setScheme(String scheme)`
    `SimpleRequestBuilder` | `setUri(String uri)`
    `SimpleRequestBuilder` | `setUri(URI uri)`
    `SimpleRequestBuilder` | `setVersion(org.apache.hc.core5.http.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(org.apache.hc.core5.http.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(org.apache.hc.core5.http.HttpRequest request)

      Since:
        5.1

    - #### digest

          protected void digest(SimpleHttpRequest request)

    - #### digest

          protected void digest(org.apache.hc.core5.http.HttpRequest request)

      Overrides:
        `digest` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setVersion

          public SimpleRequestBuilder setVersion(org.apache.hc.core5.http.ProtocolVersion version)

      Overrides:
        `setVersion` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setUri

          public SimpleRequestBuilder setUri(URI uri)

      Overrides:
        `setUri` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setUri

          public SimpleRequestBuilder setUri(String uri)

      Overrides:
        `setUri` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setScheme

          public SimpleRequestBuilder setScheme(String scheme)

      Overrides:
        `setScheme` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setAuthority

          public SimpleRequestBuilder setAuthority(org.apache.hc.core5.net.URIAuthority authority)

      Overrides:
        `setAuthority` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setHttpHost

          public SimpleRequestBuilder setHttpHost(org.apache.hc.core5.http.HttpHost httpHost)

      Overrides:
        `setHttpHost` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setPath

          public SimpleRequestBuilder setPath(String path)

      Overrides:
        `setPath` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setHeaders

          public SimpleRequestBuilder setHeaders(org.apache.hc.core5.http.Header... headers)

      Overrides:
        `setHeaders` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### addHeader

          public SimpleRequestBuilder addHeader(org.apache.hc.core5.http.Header header)

      Overrides:
        `addHeader` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### addHeader

          public SimpleRequestBuilder addHeader(String name,
                                       String value)

      Overrides:
        `addHeader` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### removeHeader

          public SimpleRequestBuilder removeHeader(org.apache.hc.core5.http.Header header)

      Overrides:
        `removeHeader` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### removeHeaders

          public SimpleRequestBuilder removeHeaders(String name)

      Overrides:
        `removeHeaders` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setHeader

          public SimpleRequestBuilder setHeader(org.apache.hc.core5.http.Header header)

      Overrides:
        `setHeader` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setHeader

          public SimpleRequestBuilder setHeader(String name,
                                       String value)

      Overrides:
        `setHeader` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setCharset

          public SimpleRequestBuilder setCharset(Charset charset)

      Overrides:
        `setCharset` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### addParameter

          public SimpleRequestBuilder addParameter(org.apache.hc.core5.http.NameValuePair nvp)

      Overrides:
        `addParameter` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### addParameter

          public SimpleRequestBuilder addParameter(String name,
                                          String value)

      Overrides:
        `addParameter` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### addParameters

          public SimpleRequestBuilder addParameters(org.apache.hc.core5.http.NameValuePair... nvps)

      Overrides:
        `addParameters` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### setAbsoluteRequestUri

          public SimpleRequestBuilder setAbsoluteRequestUri(boolean absoluteRequestUri)

      Overrides:
        `setAbsoluteRequestUri` in class `org.apache.hc.core5.http.support.AbstractRequestBuilder<SimpleHttpRequest>`

    - #### getBody

          public SimpleBody getBody()

    - #### setBody

          public SimpleRequestBuilder setBody(SimpleBody body)

    - #### setBody

          public SimpleRequestBuilder setBody(String content,
                                     org.apache.hc.core5.http.ContentType contentType)

    - #### setBody

          public SimpleRequestBuilder setBody(byte[] content,
                                     org.apache.hc.core5.http.ContentType contentType)

    - #### getRequestConfig

          public RequestConfig getRequestConfig()

    - #### setRequestConfig

          public SimpleRequestBuilder setRequestConfig(RequestConfig requestConfig)

    - #### build

          public SimpleHttpRequest build()

      Specified by:
        `build` in class `org.apache.hc.core5.http.support.AbstractMessageBuilder<SimpleHttpRequest>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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