Package org.apache.http.client.methods
Class RequestBuilder
- java.lang.Object
-
- org.apache.http.client.methods.RequestBuilder
-
public class RequestBuilder extends Object
Builder forHttpUriRequest
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 encodedentity
.- Since:
- 4.3
-
-
Method Summary
-
-
-
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(HttpRequest request)
-
setCharset
public RequestBuilder setCharset(Charset charset)
- Since:
- 4.4
-
getCharset
public Charset getCharset()
- Since:
- 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)
-
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()
-
-