org.apache.hc.core5.http.io.support

## Class ClassicRequestBuilder

- java.lang.Object
- - org.apache.hc.core5.http.support.AbstractMessageBuilder<T>
  - - org.apache.hc.core5.http.support.AbstractRequestBuilder<ClassicHttpRequest>
    - - org.apache.hc.core5.http.io.support.ClassicRequestBuilder

-     public class ClassicRequestBuilder
      extends AbstractRequestBuilder<ClassicHttpRequest>

  Builder for `ClassicHttpRequest` 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(HttpEntity)` 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
    --- | ---
    `ClassicRequestBuilder` | `addHeader(Header header)`
    `ClassicRequestBuilder` | `addHeader(String name, String value)`
    `ClassicRequestBuilder` | `addParameter(NameValuePair nvp)`
    `ClassicRequestBuilder` | `addParameter(String name, String value)`
    `ClassicRequestBuilder` | `addParameters(NameValuePair... nvps)`
    `ClassicHttpRequest` | `build()`
    `static ClassicRequestBuilder` | `copy(ClassicHttpRequest request)`
    `static ClassicRequestBuilder` | `create(String method)`
    `static ClassicRequestBuilder` | `delete()`
    `static ClassicRequestBuilder` | `delete(String uri)`
    `static ClassicRequestBuilder` | `delete(URI uri)`
    `protected void` | `digest(ClassicHttpRequest request)`
    `static ClassicRequestBuilder` | `get()`
    `static ClassicRequestBuilder` | `get(String uri)`
    `static ClassicRequestBuilder` | `get(URI uri)`
    `HttpEntity` | `getEntity()`
    `static ClassicRequestBuilder` | `head()`
    `static ClassicRequestBuilder` | `head(String uri)`
    `static ClassicRequestBuilder` | `head(URI uri)`
    `static ClassicRequestBuilder` | `options()`
    `static ClassicRequestBuilder` | `options(String uri)`
    `static ClassicRequestBuilder` | `options(URI uri)`
    `static ClassicRequestBuilder` | `patch()`
    `static ClassicRequestBuilder` | `patch(String uri)`
    `static ClassicRequestBuilder` | `patch(URI uri)`
    `static ClassicRequestBuilder` | `post()`
    `static ClassicRequestBuilder` | `post(String uri)`
    `static ClassicRequestBuilder` | `post(URI uri)`
    `static ClassicRequestBuilder` | `put()`
    `static ClassicRequestBuilder` | `put(String uri)`
    `static ClassicRequestBuilder` | `put(URI uri)`
    `ClassicRequestBuilder` | `removeHeader(Header header)`
    `ClassicRequestBuilder` | `removeHeaders(String name)`
    `ClassicRequestBuilder` | `setAbsoluteRequestUri(boolean absoluteRequestUri)`
    `ClassicRequestBuilder` | `setAuthority(URIAuthority authority)`
    `ClassicRequestBuilder` | `setCharset(Charset charset)`
    `ClassicRequestBuilder` | `setEntity(byte[] content, ContentType contentType)`
    `ClassicRequestBuilder` | `setEntity(HttpEntity entity)`
    `ClassicRequestBuilder` | `setEntity(String content)`
    `ClassicRequestBuilder` | `setEntity(String content, ContentType contentType)`
    `ClassicRequestBuilder` | `setHeader(Header header)`
    `ClassicRequestBuilder` | `setHeader(String name, String value)`
    `ClassicRequestBuilder` | `setHeaders(Header... headers)`
    `ClassicRequestBuilder` | `setHttpHost(HttpHost httpHost)`
    `ClassicRequestBuilder` | `setPath(String path)`
    `ClassicRequestBuilder` | `setScheme(String scheme)`
    `ClassicRequestBuilder` | `setUri(String uri)`
    `ClassicRequestBuilder` | `setUri(URI uri)`
    `ClassicRequestBuilder` | `setVersion(ProtocolVersion version)`
    `String` | `toString()`
    `static ClassicRequestBuilder` | `trace()`
    `static ClassicRequestBuilder` | `trace(String uri)`
    `static ClassicRequestBuilder` | `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 ClassicRequestBuilder create(String method)

    - #### get

          public static ClassicRequestBuilder get()

    - #### get

          public static ClassicRequestBuilder get(URI uri)

    - #### get

          public static ClassicRequestBuilder get(String uri)

    - #### head

          public static ClassicRequestBuilder head()

    - #### head

          public static ClassicRequestBuilder head(URI uri)

    - #### head

          public static ClassicRequestBuilder head(String uri)

    - #### patch

          public static ClassicRequestBuilder patch()

    - #### patch

          public static ClassicRequestBuilder patch(URI uri)

    - #### patch

          public static ClassicRequestBuilder patch(String uri)

    - #### post

          public static ClassicRequestBuilder post()

    - #### post

          public static ClassicRequestBuilder post(URI uri)

    - #### post

          public static ClassicRequestBuilder post(String uri)

    - #### put

          public static ClassicRequestBuilder put()

    - #### put

          public static ClassicRequestBuilder put(URI uri)

    - #### put

          public static ClassicRequestBuilder put(String uri)

    - #### delete

          public static ClassicRequestBuilder delete()

    - #### delete

          public static ClassicRequestBuilder delete(URI uri)

    - #### delete

          public static ClassicRequestBuilder delete(String uri)

    - #### trace

          public static ClassicRequestBuilder trace()

    - #### trace

          public static ClassicRequestBuilder trace(URI uri)

    - #### trace

          public static ClassicRequestBuilder trace(String uri)

    - #### options

          public static ClassicRequestBuilder options()

    - #### options

          public static ClassicRequestBuilder options(URI uri)

    - #### options

          public static ClassicRequestBuilder options(String uri)

    - #### copy

          public static ClassicRequestBuilder copy(ClassicHttpRequest request)

      Since:
        5.1

    - #### digest

          protected void digest(ClassicHttpRequest request)

    - #### setVersion

          public ClassicRequestBuilder setVersion(ProtocolVersion version)

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

    - #### setUri

          public ClassicRequestBuilder setUri(URI uri)

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

    - #### setUri

          public ClassicRequestBuilder setUri(String uri)

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

    - #### setScheme

          public ClassicRequestBuilder setScheme(String scheme)

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

    - #### setAuthority

          public ClassicRequestBuilder setAuthority(URIAuthority authority)

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

    - #### setHttpHost

          public ClassicRequestBuilder setHttpHost(HttpHost httpHost)

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

    - #### setPath

          public ClassicRequestBuilder setPath(String path)

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

    - #### setHeaders

          public ClassicRequestBuilder setHeaders(Header... headers)

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

    - #### addHeader

          public ClassicRequestBuilder addHeader(Header header)

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

    - #### addHeader

          public ClassicRequestBuilder addHeader(String name,
                                                 String value)

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

    - #### removeHeader

          public ClassicRequestBuilder removeHeader(Header header)

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

    - #### removeHeaders

          public ClassicRequestBuilder removeHeaders(String name)

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

    - #### setHeader

          public ClassicRequestBuilder setHeader(Header header)

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

    - #### setHeader

          public ClassicRequestBuilder setHeader(String name,
                                                 String value)

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

    - #### setCharset

          public ClassicRequestBuilder setCharset(Charset charset)

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

    - #### addParameter

          public ClassicRequestBuilder addParameter(NameValuePair nvp)

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

    - #### addParameter

          public ClassicRequestBuilder addParameter(String name,
                                                    String value)

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

    - #### addParameters

          public ClassicRequestBuilder addParameters(NameValuePair... nvps)

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

    - #### setAbsoluteRequestUri

          public ClassicRequestBuilder setAbsoluteRequestUri(boolean absoluteRequestUri)

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

    - #### getEntity

          public HttpEntity getEntity()

    - #### setEntity

          public ClassicRequestBuilder setEntity(HttpEntity entity)

    - #### setEntity

          public ClassicRequestBuilder setEntity(String content,
                                                 ContentType contentType)

    - #### setEntity

          public ClassicRequestBuilder setEntity(String content)

    - #### setEntity

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

    - #### build

          public ClassicHttpRequest build()

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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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