@NotThreadSafe public class RequestBuilder extends Object
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
.public static RequestBuilder create(String method)
public static RequestBuilder get()
public static RequestBuilder head()
public static RequestBuilder post()
public static RequestBuilder put()
public static RequestBuilder delete()
public static RequestBuilder trace()
public static RequestBuilder options()
public static RequestBuilder copy(HttpRequest request)
public String getMethod()
public ProtocolVersion getVersion()
public RequestBuilder setVersion(ProtocolVersion version)
public URI getUri()
public RequestBuilder setUri(URI uri)
public RequestBuilder setUri(String uri)
public RequestBuilder addHeader(Header header)
public RequestBuilder addHeader(String name, String value)
public RequestBuilder removeHeader(Header header)
public RequestBuilder removeHeaders(String name)
public RequestBuilder setHeader(Header header)
public RequestBuilder setHeader(String name, String value)
public HttpEntity getEntity()
public RequestBuilder setEntity(HttpEntity entity)
public List<NameValuePair> getParameters()
public RequestBuilder addParameter(NameValuePair nvp)
public RequestBuilder addParameter(String name, String value)
public RequestBuilder addParameters(NameValuePair... nvps)
public RequestConfig getConfig()
public RequestBuilder setConfig(RequestConfig config)
public HttpUriRequest build()
Copyright © 1999–2013 The Apache Software Foundation. All rights reserved.