com.ning.http.client
Class RequestBuilderBase<T extends RequestBuilderBase<T>>
java.lang.Object
com.ning.http.client.RequestBuilderBase<T>
- Type Parameters:
T
-
- Direct Known Subclasses:
- AsyncHttpClient.BoundRequestBuilder, RequestBuilder
public abstract class RequestBuilderBase<T extends RequestBuilderBase<T>>
- extends Object
Builder for Request
Field Summary |
protected com.ning.http.client.RequestBuilderBase.RequestImpl |
request
|
protected boolean |
useRawUrl
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
request
protected final com.ning.http.client.RequestBuilderBase.RequestImpl request
useRawUrl
protected boolean useRawUrl
RequestBuilderBase
protected RequestBuilderBase(Class<T> derived,
String method,
boolean rawUrls)
RequestBuilderBase
protected RequestBuilderBase(Class<T> derived,
Request prototype)
setUrl
public T setUrl(String url)
setVirtualHost
public T setVirtualHost(String virtualHost)
setHeader
public T setHeader(String name,
String value)
addHeader
public T addHeader(String name,
String value)
setHeaders
public T setHeaders(FluentCaseInsensitiveStringsMap headers)
setHeaders
public T setHeaders(Map<String,Collection<String>> headers)
setContentLength
public T setContentLength(int length)
addCookie
public T addCookie(Cookie cookie)
setBody
public T setBody(File file)
setBody
public T setBody(byte[] data)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
setBody
public T setBody(String data)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
setBody
public T setBody(InputStream stream)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
setBody
public T setBody(Request.EntityWriter dataWriter)
setBody
public T setBody(Request.EntityWriter dataWriter,
long length)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
setBody
public T setBody(BodyGenerator bodyGenerator)
addQueryParameter
public T addQueryParameter(String name,
String value)
setQueryParameters
public T setQueryParameters(FluentStringsMap parameters)
addParameter
public T addParameter(String key,
String value)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
setParameters
public T setParameters(FluentStringsMap parameters)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
setParameters
public T setParameters(Map<String,Collection<String>> parameters)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
addBodyPart
public T addBodyPart(Part part)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
setProxyServer
public T setProxyServer(ProxyServer proxyServer)
setRealm
public T setRealm(Realm realm)
setFollowRedirects
public T setFollowRedirects(boolean followRedirects)
setPerRequestConfig
public T setPerRequestConfig(PerRequestConfig perRequestConfig)
setRangeOffset
public T setRangeOffset(long rangeOffset)
setMethod
public T setMethod(String method)
setBodyEncoding
public T setBodyEncoding(String charset)
build
public Request build()
addOrReplaceCookie
public T addOrReplaceCookie(Cookie cookie)
Copyright © 2011. All Rights Reserved.