com.ning.http.client
Class RequestBuilder
java.lang.Object
com.ning.http.client.RequestBuilderBase<RequestBuilder>
com.ning.http.client.RequestBuilder
public class RequestBuilder
- extends RequestBuilderBase<RequestBuilder>
Builder for a Request
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RequestBuilder
public RequestBuilder()
RequestBuilder
public RequestBuilder(String method)
RequestBuilder
public RequestBuilder(String method,
boolean useRawUrl)
RequestBuilder
public RequestBuilder(Request prototype)
addBodyPart
public RequestBuilder addBodyPart(Part part)
throws IllegalArgumentException
- Overrides:
addBodyPart
in class RequestBuilderBase<RequestBuilder>
- Throws:
IllegalArgumentException
addCookie
public RequestBuilder addCookie(Cookie cookie)
- Overrides:
addCookie
in class RequestBuilderBase<RequestBuilder>
addHeader
public RequestBuilder addHeader(String name,
String value)
- Overrides:
addHeader
in class RequestBuilderBase<RequestBuilder>
addParameter
public RequestBuilder addParameter(String key,
String value)
throws IllegalArgumentException
- Overrides:
addParameter
in class RequestBuilderBase<RequestBuilder>
- Throws:
IllegalArgumentException
addQueryParameter
public RequestBuilder addQueryParameter(String name,
String value)
- Overrides:
addQueryParameter
in class RequestBuilderBase<RequestBuilder>
setQueryParameters
public RequestBuilder setQueryParameters(FluentStringsMap parameters)
- Overrides:
setQueryParameters
in class RequestBuilderBase<RequestBuilder>
build
public Request build()
- Overrides:
build
in class RequestBuilderBase<RequestBuilder>
setBody
public RequestBuilder setBody(byte[] data)
throws IllegalArgumentException
- Overrides:
setBody
in class RequestBuilderBase<RequestBuilder>
- Throws:
IllegalArgumentException
setBody
public RequestBuilder setBody(Request.EntityWriter dataWriter,
long length)
throws IllegalArgumentException
- Overrides:
setBody
in class RequestBuilderBase<RequestBuilder>
- Throws:
IllegalArgumentException
setBody
public RequestBuilder setBody(Request.EntityWriter dataWriter)
- Overrides:
setBody
in class RequestBuilderBase<RequestBuilder>
setBody
@Deprecated
public RequestBuilder setBody(InputStream stream)
throws IllegalArgumentException
- Deprecated.
RequestBuilderBase.setBody(BodyGenerator)
setBody(new InputStreamBodyGenerator(inputStream))
- Deprecated - Use setBody(new InputStreamBodyGenerator(inputStream)).
- Overrides:
setBody
in class RequestBuilderBase<RequestBuilder>
- Parameters:
stream
- - An InputStream
- Returns:
- a
RequestBuilder
- Throws:
IllegalArgumentException
- See Also:
InputStreamBodyGenerator(inputStream)
,
InputStreamBodyGenerator
setBody
public RequestBuilder setBody(String data)
throws IllegalArgumentException
- Overrides:
setBody
in class RequestBuilderBase<RequestBuilder>
- Throws:
IllegalArgumentException
setHeader
public RequestBuilder setHeader(String name,
String value)
- Overrides:
setHeader
in class RequestBuilderBase<RequestBuilder>
setHeaders
public RequestBuilder setHeaders(FluentCaseInsensitiveStringsMap headers)
- Overrides:
setHeaders
in class RequestBuilderBase<RequestBuilder>
setHeaders
public RequestBuilder setHeaders(Map<String,Collection<String>> headers)
- Overrides:
setHeaders
in class RequestBuilderBase<RequestBuilder>
setParameters
public RequestBuilder setParameters(Map<String,Collection<String>> parameters)
throws IllegalArgumentException
- Overrides:
setParameters
in class RequestBuilderBase<RequestBuilder>
- Throws:
IllegalArgumentException
setParameters
public RequestBuilder setParameters(FluentStringsMap parameters)
throws IllegalArgumentException
- Overrides:
setParameters
in class RequestBuilderBase<RequestBuilder>
- Throws:
IllegalArgumentException
setMethod
public RequestBuilder setMethod(String method)
- Overrides:
setMethod
in class RequestBuilderBase<RequestBuilder>
setUrl
public RequestBuilder setUrl(String url)
- Overrides:
setUrl
in class RequestBuilderBase<RequestBuilder>
setProxyServer
public RequestBuilder setProxyServer(ProxyServer proxyServer)
- Overrides:
setProxyServer
in class RequestBuilderBase<RequestBuilder>
setVirtualHost
public RequestBuilder setVirtualHost(String virtualHost)
- Overrides:
setVirtualHost
in class RequestBuilderBase<RequestBuilder>
setFollowRedirects
public RequestBuilder setFollowRedirects(boolean followRedirects)
- Overrides:
setFollowRedirects
in class RequestBuilderBase<RequestBuilder>
addOrReplaceCookie
public RequestBuilder addOrReplaceCookie(Cookie c)
- Overrides:
addOrReplaceCookie
in class RequestBuilderBase<RequestBuilder>
Copyright © 2011. All Rights Reserved.