org.apache.http.client.methods
Class RequestBuilder

java.lang.Object
  extended by org.apache.http.client.methods.RequestBuilder

public class RequestBuilder
extends Object

Builder for HttpUriRequest 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(org.apache.http.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:
4.3

Method Summary
 RequestBuilder addHeader(org.apache.http.Header header)
           
 RequestBuilder addHeader(String name, String value)
           
 RequestBuilder addParameter(org.apache.http.NameValuePair nvp)
           
 RequestBuilder addParameter(String name, String value)
           
 RequestBuilder addParameters(org.apache.http.NameValuePair... nvps)
           
 HttpUriRequest build()
           
static RequestBuilder copy(org.apache.http.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()
           
 org.apache.http.HttpEntity getEntity()
           
 org.apache.http.Header getFirstHeader(String name)
           
 org.apache.http.Header[] getHeaders(String name)
           
 org.apache.http.Header getLastHeader(String name)
           
 String getMethod()
           
 List<org.apache.http.NameValuePair> getParameters()
           
 URI getUri()
           
 org.apache.http.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(org.apache.http.Header header)
           
 RequestBuilder removeHeaders(String name)
           
 RequestBuilder setCharset(Charset charset)
           
 RequestBuilder setConfig(RequestConfig config)
           
 RequestBuilder setEntity(org.apache.http.HttpEntity entity)
           
 RequestBuilder setHeader(org.apache.http.Header header)
           
 RequestBuilder setHeader(String name, String value)
           
 RequestBuilder setUri(String uri)
           
 RequestBuilder setUri(URI uri)
           
 RequestBuilder setVersion(org.apache.http.ProtocolVersion version)
           
 String toString()
           
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, wait, wait, wait
 

Method Detail

create

public static RequestBuilder create(String method)

get

public static RequestBuilder get()

get

public static RequestBuilder get(URI uri)
Since:
4.4

get

public static RequestBuilder get(String uri)
Since:
4.4

head

public static RequestBuilder head()

head

public static RequestBuilder head(URI uri)
Since:
4.4

head

public static RequestBuilder head(String uri)
Since:
4.4

patch

public static RequestBuilder patch()
Since:
4.4

patch

public static RequestBuilder patch(URI uri)
Since:
4.4

patch

public static RequestBuilder patch(String uri)
Since:
4.4

post

public static RequestBuilder post()

post

public static RequestBuilder post(URI uri)
Since:
4.4

post

public static RequestBuilder post(String uri)
Since:
4.4

put

public static RequestBuilder put()

put

public static RequestBuilder put(URI uri)
Since:
4.4

put

public static RequestBuilder put(String uri)
Since:
4.4

delete

public static RequestBuilder delete()

delete

public static RequestBuilder delete(URI uri)
Since:
4.4

delete

public static RequestBuilder delete(String uri)
Since:
4.4

trace

public static RequestBuilder trace()

trace

public static RequestBuilder trace(URI uri)
Since:
4.4

trace

public static RequestBuilder trace(String uri)
Since:
4.4

options

public static RequestBuilder options()

options

public static RequestBuilder options(URI uri)
Since:
4.4

options

public static RequestBuilder options(String uri)
Since:
4.4

copy

public static RequestBuilder copy(org.apache.http.HttpRequest request)

setCharset

public RequestBuilder setCharset(Charset charset)
Since:
4.4

getCharset

public Charset getCharset()
Since:
4.4

getMethod

public String getMethod()

getVersion

public org.apache.http.ProtocolVersion getVersion()

setVersion

public RequestBuilder setVersion(org.apache.http.ProtocolVersion version)

getUri

public URI getUri()

setUri

public RequestBuilder setUri(URI uri)

setUri

public RequestBuilder setUri(String uri)

getFirstHeader

public org.apache.http.Header getFirstHeader(String name)

getLastHeader

public org.apache.http.Header getLastHeader(String name)

getHeaders

public org.apache.http.Header[] getHeaders(String name)

addHeader

public RequestBuilder addHeader(org.apache.http.Header header)

addHeader

public RequestBuilder addHeader(String name,
                                String value)

removeHeader

public RequestBuilder removeHeader(org.apache.http.Header header)

removeHeaders

public RequestBuilder removeHeaders(String name)

setHeader

public RequestBuilder setHeader(org.apache.http.Header header)

setHeader

public RequestBuilder setHeader(String name,
                                String value)

getEntity

public org.apache.http.HttpEntity getEntity()

setEntity

public RequestBuilder setEntity(org.apache.http.HttpEntity entity)

getParameters

public List<org.apache.http.NameValuePair> getParameters()

addParameter

public RequestBuilder addParameter(org.apache.http.NameValuePair nvp)

addParameter

public RequestBuilder addParameter(String name,
                                   String value)

addParameters

public RequestBuilder addParameters(org.apache.http.NameValuePair... nvps)

getConfig

public RequestConfig getConfig()

setConfig

public RequestBuilder setConfig(RequestConfig config)

build

public HttpUriRequest build()

toString

public String toString()
Overrides:
toString in class Object


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