Package org.asynchttpclient
Class DefaultRequest
- java.lang.Object
-
- org.asynchttpclient.DefaultRequest
-
-
Field Summary
Fields Modifier and Type Field Description @Nullable ProxyServer
proxyServer
-
Constructor Summary
Constructors Constructor Description DefaultRequest(String method, Uri uri, @Nullable InetAddress address, @Nullable InetAddress localAddress, io.netty.handler.codec.http.HttpHeaders headers, List<io.netty.handler.codec.http.cookie.Cookie> cookies, byte @Nullable [] byteData, @Nullable List<byte[]> compositeByteData, @Nullable String stringData, @Nullable ByteBuffer byteBufferData, @Nullable io.netty.buffer.ByteBuf byteBufData, @Nullable InputStream streamData, @Nullable BodyGenerator bodyGenerator, List<Param> formParams, List<Part> bodyParts, @Nullable String virtualHost, @Nullable ProxyServer proxyServer, @Nullable Realm realm, @Nullable File file, @Nullable Boolean followRedirect, @Nullable Duration requestTimeout, @Nullable Duration readTimeout, long rangeOffset, @Nullable Charset charset, ChannelPoolPartitioning channelPoolPartitioning, io.netty.resolver.NameResolver<InetAddress> nameResolver)
-
Method Summary
-
-
-
Field Detail
-
proxyServer
@Nullable public final @Nullable ProxyServer proxyServer
-
-
Constructor Detail
-
DefaultRequest
public DefaultRequest(String method, Uri uri, @Nullable @Nullable InetAddress address, @Nullable @Nullable InetAddress localAddress, io.netty.handler.codec.http.HttpHeaders headers, List<io.netty.handler.codec.http.cookie.Cookie> cookies, byte @Nullable [] byteData, @Nullable @Nullable List<byte[]> compositeByteData, @Nullable @Nullable String stringData, @Nullable @Nullable ByteBuffer byteBufferData, @Nullable @Nullable io.netty.buffer.ByteBuf byteBufData, @Nullable @Nullable InputStream streamData, @Nullable @Nullable BodyGenerator bodyGenerator, List<Param> formParams, List<Part> bodyParts, @Nullable @Nullable String virtualHost, @Nullable @Nullable ProxyServer proxyServer, @Nullable @Nullable Realm realm, @Nullable @Nullable File file, @Nullable @Nullable Boolean followRedirect, @Nullable @Nullable Duration requestTimeout, @Nullable @Nullable Duration readTimeout, long rangeOffset, @Nullable @Nullable Charset charset, ChannelPoolPartitioning channelPoolPartitioning, io.netty.resolver.NameResolver<InetAddress> nameResolver)
-
-
Method Detail
-
getUrl
public String getUrl()
-
getMethod
public String getMethod()
-
getAddress
@Nullable public @Nullable InetAddress getAddress()
- Specified by:
getAddress
in interfaceRequest
- Returns:
- the InetAddress to be used to bypass uri's hostname resolution
-
getLocalAddress
@Nullable public @Nullable InetAddress getLocalAddress()
- Specified by:
getLocalAddress
in interfaceRequest
- Returns:
- the local address to bind from
-
getHeaders
public io.netty.handler.codec.http.HttpHeaders getHeaders()
- Specified by:
getHeaders
in interfaceRequest
- Returns:
- the HTTP headers
-
getCookies
public List<io.netty.handler.codec.http.cookie.Cookie> getCookies()
- Specified by:
getCookies
in interfaceRequest
- Returns:
- the HTTP cookies
-
getByteData
public byte @Nullable [] getByteData()
- Specified by:
getByteData
in interfaceRequest
- Returns:
- the request's body byte array (only non-null if it was set this way)
-
getCompositeByteData
@Nullable public @Nullable List<byte[]> getCompositeByteData()
- Specified by:
getCompositeByteData
in interfaceRequest
- Returns:
- the request's body array of byte arrays (only non-null if it was set this way)
-
getStringData
@Nullable public @Nullable String getStringData()
- Specified by:
getStringData
in interfaceRequest
- Returns:
- the request's body string (only non-null if it was set this way)
-
getByteBufferData
@Nullable public @Nullable ByteBuffer getByteBufferData()
- Specified by:
getByteBufferData
in interfaceRequest
- Returns:
- the request's body ByteBuffer (only non-null if it was set this way)
-
getByteBufData
@Nullable public @Nullable io.netty.buffer.ByteBuf getByteBufData()
- Specified by:
getByteBufData
in interfaceRequest
- Returns:
- the request's body ByteBuf (only non-null if it was set this way)
-
getStreamData
@Nullable public @Nullable InputStream getStreamData()
- Specified by:
getStreamData
in interfaceRequest
- Returns:
- the request's body InputStream (only non-null if it was set this way)
-
getBodyGenerator
@Nullable public @Nullable BodyGenerator getBodyGenerator()
- Specified by:
getBodyGenerator
in interfaceRequest
- Returns:
- the request's body BodyGenerator (only non-null if it was set this way)
-
getFormParams
public List<Param> getFormParams()
- Specified by:
getFormParams
in interfaceRequest
- Returns:
- the request's form parameters
-
getBodyParts
public List<Part> getBodyParts()
- Specified by:
getBodyParts
in interfaceRequest
- Returns:
- the multipart parts
-
getVirtualHost
@Nullable public @Nullable String getVirtualHost()
- Specified by:
getVirtualHost
in interfaceRequest
- Returns:
- the virtual host to connect to
-
getProxyServer
@Nullable public @Nullable ProxyServer getProxyServer()
- Specified by:
getProxyServer
in interfaceRequest
- Returns:
- the proxy server to be used to perform this request (overrides the one defined in config)
-
getRealm
@Nullable public @Nullable Realm getRealm()
-
getFile
@Nullable public @Nullable File getFile()
-
getFollowRedirect
@Nullable public @Nullable Boolean getFollowRedirect()
- Specified by:
getFollowRedirect
in interfaceRequest
- Returns:
- if this request is to follow redirects. Non null values means "override config value".
-
getRequestTimeout
public Duration getRequestTimeout()
- Specified by:
getRequestTimeout
in interfaceRequest
- Returns:
- the request timeout. Non zero values means "override config value".
-
getReadTimeout
public Duration getReadTimeout()
- Specified by:
getReadTimeout
in interfaceRequest
- Returns:
- the read timeout. Non-zero values means "override config value".
-
getRangeOffset
public long getRangeOffset()
- Specified by:
getRangeOffset
in interfaceRequest
- Returns:
- the range header value, or 0 is not set.
-
getCharset
@Nullable public @Nullable Charset getCharset()
- Specified by:
getCharset
in interfaceRequest
- Returns:
- the charset value used when decoding the request's body.
-
getChannelPoolPartitioning
public ChannelPoolPartitioning getChannelPoolPartitioning()
- Specified by:
getChannelPoolPartitioning
in interfaceRequest
- Returns:
- the strategy to compute ChannelPool's keys
-
getNameResolver
public io.netty.resolver.NameResolver<InetAddress> getNameResolver()
- Specified by:
getNameResolver
in interfaceRequest
- Returns:
- the NameResolver to be used to resolve hostnams's IP
-
getQueryParams
public List<Param> getQueryParams()
- Specified by:
getQueryParams
in interfaceRequest
- Returns:
- the query params resolved from the url/uri
-
-