org.apache.http.client.methods

## Class RequestBuilder

- java.lang.Object
- - org.apache.http.client.methods.RequestBuilder

-     public class RequestBuilder
      extends Object

  生成器为`HttpUriRequest`实例。

  请注意，此类根据请求的组合来对参数进行不同的处理：如果请求具有使用`setEntity(org.apache.http.HttpEntity)`显式设置的内容实体，或者不是实体封装方法（如POST或PUT），则参数将添加到查询组件的请求URI。 否则，参数将被添加为编码`entity`的URL。

  从以下版本开始：
    4.3

- - ### 方法摘要

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RequestBuilder` | `addHeader(Header header)`
    `RequestBuilder` | `addHeader(String name, String value)`
    `RequestBuilder` | `addParameter(NameValuePair nvp)`
    `RequestBuilder` | `addParameter(String name, String value)`
    `RequestBuilder` | `addParameters(NameValuePair... nvps)`
    `HttpUriRequest` | `build()`
    `static RequestBuilder` | `copy(HttpRequest request)`
    `static RequestBuilder` | `create(String method)`
    `static RequestBuilder` | `delete()`
    `static RequestBuilder` | `delete(String uri)`
    `static RequestBuilder` | `delete(URI uri)`
    `static RequestBuilder` | `get()`
    `static RequestBuilder` | `get(String uri)`
    `static RequestBuilder` | `get(URI uri)`
    `Charset` | `getCharset()`
    `RequestConfig` | `getConfig()`
    `HttpEntity` | `getEntity()`
    `Header` | `getFirstHeader(String name)`
    `Header[]` | `getHeaders(String name)`
    `Header` | `getLastHeader(String name)`
    `String` | `getMethod()`
    `List<NameValuePair>` | `getParameters()`
    `URI` | `getUri()`
    `ProtocolVersion` | `getVersion()`
    `static RequestBuilder` | `head()`
    `static RequestBuilder` | `head(String uri)`
    `static RequestBuilder` | `head(URI uri)`
    `static RequestBuilder` | `options()`
    `static RequestBuilder` | `options(String uri)`
    `static RequestBuilder` | `options(URI uri)`
    `static RequestBuilder` | `patch()`
    `static RequestBuilder` | `patch(String uri)`
    `static RequestBuilder` | `patch(URI uri)`
    `static RequestBuilder` | `post()`
    `static RequestBuilder` | `post(String uri)`
    `static RequestBuilder` | `post(URI uri)`
    `static RequestBuilder` | `put()`
    `static RequestBuilder` | `put(String uri)`
    `static RequestBuilder` | `put(URI uri)`
    `RequestBuilder` | `removeHeader(Header header)`
    `RequestBuilder` | `removeHeaders(String name)`
    `RequestBuilder` | `setCharset(Charset charset)`
    `RequestBuilder` | `setConfig(RequestConfig config)`
    `RequestBuilder` | `setEntity(HttpEntity entity)`
    `RequestBuilder` | `setHeader(Header header)`
    `RequestBuilder` | `setHeader(String name, String value)`
    `RequestBuilder` | `setUri(String uri)`
    `RequestBuilder` | `setUri(URI uri)`
    `RequestBuilder` | `setVersion(ProtocolVersion version)`
    `static RequestBuilder` | `trace()`
    `static RequestBuilder` | `trace(String uri)`
    `static RequestBuilder` | `trace(URI uri)`

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

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

- - ### 方法详细信息

    - #### create

          public static RequestBuilder create(String method)

    - #### get

          public static RequestBuilder get()

    - #### get

          public static RequestBuilder get(URI uri)

      从以下版本开始：
        4.4

    - #### get

          public static RequestBuilder get(String uri)

      从以下版本开始：
        4.4

    - #### head

          public static RequestBuilder head()

    - #### head

          public static RequestBuilder head(URI uri)

      从以下版本开始：
        4.4

    - #### head

          public static RequestBuilder head(String uri)

      从以下版本开始：
        4.4

    - #### patch

          public static RequestBuilder patch()

      从以下版本开始：
        4.4

    - #### patch

          public static RequestBuilder patch(URI uri)

      从以下版本开始：
        4.4

    - #### patch

          public static RequestBuilder patch(String uri)

      从以下版本开始：
        4.4

    - #### post

          public static RequestBuilder post()

    - #### post

          public static RequestBuilder post(URI uri)

      从以下版本开始：
        4.4

    - #### post

          public static RequestBuilder post(String uri)

      从以下版本开始：
        4.4

    - #### put

          public static RequestBuilder put()

    - #### put

          public static RequestBuilder put(URI uri)

      从以下版本开始：
        4.4

    - #### put

          public static RequestBuilder put(String uri)

      从以下版本开始：
        4.4

    - #### delete

          public static RequestBuilder delete()

    - #### delete

          public static RequestBuilder delete(URI uri)

      从以下版本开始：
        4.4

    - #### delete

          public static RequestBuilder delete(String uri)

      从以下版本开始：
        4.4

    - #### trace

          public static RequestBuilder trace()

    - #### trace

          public static RequestBuilder trace(URI uri)

      从以下版本开始：
        4.4

    - #### trace

          public static RequestBuilder trace(String uri)

      从以下版本开始：
        4.4

    - #### options

          public static RequestBuilder options()

    - #### options

          public static RequestBuilder options(URI uri)

      从以下版本开始：
        4.4

    - #### options

          public static RequestBuilder options(String uri)

      从以下版本开始：
        4.4

    - #### copy

          public static RequestBuilder copy(HttpRequest request)

    - #### setCharset

          public RequestBuilder setCharset(Charset charset)

      从以下版本开始：
        4.4

    - #### getCharset

          public Charset getCharset()

      从以下版本开始：
        4.4

    - #### getMethod

          public String getMethod()

    - #### getVersion

          public ProtocolVersion getVersion()

    - #### setVersion

          public RequestBuilder setVersion(ProtocolVersion version)

    - #### getUri

          public URI getUri()

    - #### setUri

          public RequestBuilder setUri(URI uri)

    - #### setUri

          public RequestBuilder setUri(String uri)

    - #### getFirstHeader

          public Header getFirstHeader(String name)

    - #### getLastHeader

          public Header getLastHeader(String name)

    - #### getHeaders

          public Header[] getHeaders(String name)

    - #### addHeader

          public RequestBuilder addHeader(Header header)

    - #### addHeader

          public RequestBuilder addHeader(String name,
                                 String value)

    - #### removeHeader

          public RequestBuilder removeHeader(Header header)

    - #### removeHeaders

          public RequestBuilder removeHeaders(String name)

    - #### setHeader

          public RequestBuilder setHeader(Header header)

    - #### setHeader

          public RequestBuilder setHeader(String name,
                                 String value)

    - #### getEntity

          public HttpEntity getEntity()

    - #### setEntity

          public RequestBuilder setEntity(HttpEntity entity)

    - #### getParameters

          public List<NameValuePair> getParameters()

    - #### addParameter

          public RequestBuilder addParameter(NameValuePair nvp)

    - #### addParameter

          public RequestBuilder addParameter(String name,
                                    String value)

    - #### addParameters

          public RequestBuilder addParameters(NameValuePair... nvps)

    - #### getConfig

          public RequestConfig getConfig()

    - #### setConfig

          public RequestBuilder setConfig(RequestConfig config)

    - #### build

          public HttpUriRequest build()

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

本帮助文档是使用 《谷歌翻译》翻译，请与英文版配合使用 by--QQ:654638585