public static final class SimpleAsyncHttpClient.Builder extends Object implements SimpleAsyncHttpClient.DerivedBuilder
Constructor and Description |
---|
SimpleAsyncHttpClient.Builder() |
public SimpleAsyncHttpClient.Builder addBodyPart(Part part)
addBodyPart
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder addCookie(Cookie cookie)
addCookie
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder addHeader(String name, String value)
addHeader
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder addFormParam(String key, String value)
addFormParam
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder addQueryParam(String name, String value)
addQueryParam
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setHeader(String name, String value)
setHeader
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setHeaders(FluentCaseInsensitiveStringsMap headers)
setHeaders
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setHeaders(Map<String,Collection<String>> headers)
setHeaders
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setFormParams(List<Param> params)
setFormParams
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setFormParams(Map<String,List<String>> params)
setFormParams
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setUrl(String url)
setUrl
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setVirtualHost(String virtualHost)
setVirtualHost
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setFollowRedirects(boolean followRedirects)
setFollowRedirects
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setMaximumConnectionsTotal(int defaultMaxTotalConnections)
public SimpleAsyncHttpClient.Builder setMaximumConnectionsPerHost(int defaultMaxConnectionPerHost)
public SimpleAsyncHttpClient.Builder setConnectionTimeout(int connectionTimeuot)
public SimpleAsyncHttpClient.Builder setPooledConnectionIdleTimeout(int pooledConnectionIdleTimeout)
public SimpleAsyncHttpClient.Builder setRequestTimeout(int defaultRequestTimeout)
public SimpleAsyncHttpClient.Builder setMaximumNumberOfRedirects(int maxDefaultRedirects)
public SimpleAsyncHttpClient.Builder setCompressionEnabled(boolean compressionEnabled)
public SimpleAsyncHttpClient.Builder setUserAgent(String userAgent)
public SimpleAsyncHttpClient.Builder setAllowPoolingConnections(boolean allowPoolingConnections)
public SimpleAsyncHttpClient.Builder setExecutorService(ExecutorService applicationThreadPool)
public SimpleAsyncHttpClient.Builder setSSLContext(SSLContext sslContext)
public SimpleAsyncHttpClient.Builder setRealmNtlmDomain(String ntlmDomain)
public SimpleAsyncHttpClient.Builder setRealmPrincipal(String principal)
public SimpleAsyncHttpClient.Builder setRealmPassword(String password)
public SimpleAsyncHttpClient.Builder setRealmScheme(Realm.AuthScheme scheme)
public SimpleAsyncHttpClient.Builder setRealmName(String realmName)
public SimpleAsyncHttpClient.Builder setRealmUsePreemptiveAuth(boolean usePreemptiveAuth)
public SimpleAsyncHttpClient.Builder setRealmEnconding(String enc)
public SimpleAsyncHttpClient.Builder setProxyProtocol(ProxyServer.Protocol protocol)
public SimpleAsyncHttpClient.Builder setProxyHost(String host)
public SimpleAsyncHttpClient.Builder setProxyPrincipal(String principal)
public SimpleAsyncHttpClient.Builder setProxyPassword(String password)
public SimpleAsyncHttpClient.Builder setProxyPort(int port)
public SimpleAsyncHttpClient.Builder setDefaultThrowableHandler(ThrowableHandler throwableHandler)
public SimpleAsyncHttpClient.Builder setErrorDocumentBehaviour(SimpleAsyncHttpClient.ErrorDocumentBehaviour behaviour)
BodyConsumer
after an error status code was received (e.g.
404). Default is SimpleAsyncHttpClient.ErrorDocumentBehaviour.WRITE
.public SimpleAsyncHttpClient.Builder setResumableDownload(boolean enableResumableDownload)
ResumableBodyConsumer
.setResumableDownload
in interface SimpleAsyncHttpClient.DerivedBuilder
public SimpleAsyncHttpClient.Builder setListener(SimpleAHCTransferListener listener)
public SimpleAsyncHttpClient.Builder setMaxRequestRetry(int maxRequestRetry)
IOException
occurs because of a Network exception.maxRequestRetry
- the number of time a request will be retriedpublic SimpleAsyncHttpClient.Builder setProviderClass(String providerClass)
public SimpleAsyncHttpClient.Builder setAcceptAnyCertificate(boolean acceptAnyCertificate)
public SimpleAsyncHttpClient build()
build
in interface SimpleAsyncHttpClient.DerivedBuilder
Copyright © 2014. All Rights Reserved.