org.apache.http.client.methods
Class RequestBuilder
java.lang.Object
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
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.