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

## Class ClassicRequestBuilder

- java.lang.Object
- - org.apache.hc.core5.http.io.support.ClassicRequestBuilder

-     public class ClassicRequestBuilder
      extends Object

  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

    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` | `create(String method)`
    `static ClassicRequestBuilder` | `delete()`
    `static ClassicRequestBuilder` | `delete(String uri)`
    `static ClassicRequestBuilder` | `delete(URI uri)`
    `static ClassicRequestBuilder` | `get()`
    `static ClassicRequestBuilder` | `get(String uri)`
    `static ClassicRequestBuilder` | `get(URI uri)`
    `Charset` | `getCharset()`
    `HttpEntity` | `getEntity()`
    `Header` | `getFirstHeader(String name)`
    `Header[]` | `getHeaders(String name)`
    `Header` | `getLastHeader(String name)`
    `String` | `getMethod()`
    `List<NameValuePair>` | `getParameters()`
    `URI` | `getUri()`
    `ProtocolVersion` | `getVersion()`
    `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` | `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` | `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 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)

    - #### setCharset

          public ClassicRequestBuilder setCharset(Charset charset)

    - #### getCharset

          public Charset getCharset()

    - #### getMethod

          public String getMethod()

    - #### getVersion

          public ProtocolVersion getVersion()

    - #### setVersion

          public ClassicRequestBuilder setVersion(ProtocolVersion version)

    - #### getUri

          public URI getUri()

    - #### setUri

          public ClassicRequestBuilder setUri(URI uri)

    - #### setUri

          public ClassicRequestBuilder setUri(String uri)

    - #### getHeaders

          public Header[] getHeaders(String name)

    - #### setHeaders

          public ClassicRequestBuilder setHeaders(Header... headers)

    - #### getFirstHeader

          public Header getFirstHeader(String name)

    - #### getLastHeader

          public Header getLastHeader(String name)

    - #### addHeader

          public ClassicRequestBuilder addHeader(Header header)

    - #### addHeader

          public ClassicRequestBuilder addHeader(String name,
                                        String value)

    - #### removeHeader

          public ClassicRequestBuilder removeHeader(Header header)

    - #### removeHeaders

          public ClassicRequestBuilder removeHeaders(String name)

    - #### setHeader

          public ClassicRequestBuilder setHeader(Header header)

    - #### setHeader

          public ClassicRequestBuilder setHeader(String name,
                                        String value)

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

    - #### getParameters

          public List<NameValuePair> getParameters()

    - #### addParameter

          public ClassicRequestBuilder addParameter(NameValuePair nvp)

    - #### addParameter

          public ClassicRequestBuilder addParameter(String name,
                                           String value)

    - #### addParameters

          public ClassicRequestBuilder addParameters(NameValuePair... nvps)

    - #### build

          public ClassicHttpRequest build()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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