com.ning.http.client
Class RequestBuilderBase<T extends RequestBuilderBase<T>>

java.lang.Object
  extended by 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
           
 
Constructor Summary
protected RequestBuilderBase(Class<T> derived, Request prototype)
           
protected RequestBuilderBase(Class<T> derived, String method, boolean rawUrls)
           
 
Method Summary
 T addBodyPart(Part part)
           
 T addCookie(Cookie cookie)
           
 T addHeader(String name, String value)
           
 T addOrReplaceCookie(Cookie cookie)
           
 T addParameter(String key, String value)
           
 T addQueryParameter(String name, String value)
           
 Request build()
           
 T setBody(BodyGenerator bodyGenerator)
           
 T setBody(byte[] data)
           
 T setBody(File file)
           
 T setBody(InputStream stream)
           
 T setBody(Request.EntityWriter dataWriter)
           
 T setBody(Request.EntityWriter dataWriter, long length)
           
 T setBody(String data)
           
 T setBodyEncoding(String charset)
           
 T setContentLength(int length)
           
 T setFollowRedirects(boolean followRedirects)
           
 T setHeader(String name, String value)
           
 T setHeaders(FluentCaseInsensitiveStringsMap headers)
           
 T setHeaders(Map<String,Collection<String>> headers)
           
 T setMethod(String method)
           
 T setParameters(FluentStringsMap parameters)
           
 T setParameters(Map<String,Collection<String>> parameters)
           
 T setPerRequestConfig(PerRequestConfig perRequestConfig)
           
 T setProxyServer(ProxyServer proxyServer)
           
 T setQueryParameters(FluentStringsMap parameters)
           
 T setRangeOffset(long rangeOffset)
           
 T setRealm(Realm realm)
           
 T setUrl(String url)
           
 T setVirtualHost(String virtualHost)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

request

protected final com.ning.http.client.RequestBuilderBase.RequestImpl request

useRawUrl

protected boolean useRawUrl
Constructor Detail

RequestBuilderBase

protected RequestBuilderBase(Class<T> derived,
                             String method,
                             boolean rawUrls)

RequestBuilderBase

protected RequestBuilderBase(Class<T> derived,
                             Request prototype)
Method Detail

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.