Package org.asynchttpclient
Interface Request
-
- All Known Implementing Classes:
DefaultRequest
public interface Request
The Request class can be used to construct HTTP request:Request r = new RequestBuilder() .setUrl("url") .setRealm( new Realm.Builder("principal", "password") .setRealmName("MyRealm") .setScheme(Realm.AuthScheme.BASIC) ).build();
-
-
Method Summary
-
-
-
Method Detail
-
getMethod
String getMethod()
- Returns:
- the request's HTTP method (GET, POST, etc.)
-
getUri
Uri getUri()
- Returns:
- the uri
-
getUrl
String getUrl()
- Returns:
- the url (the uri's String form)
-
getAddress
@Nullable @Nullable InetAddress getAddress()
- Returns:
- the InetAddress to be used to bypass uri's hostname resolution
-
getLocalAddress
@Nullable @Nullable InetAddress getLocalAddress()
- Returns:
- the local address to bind from
-
getHeaders
io.netty.handler.codec.http.HttpHeaders getHeaders()
- Returns:
- the HTTP headers
-
getCookies
List<io.netty.handler.codec.http.cookie.Cookie> getCookies()
- Returns:
- the HTTP cookies
-
getByteData
byte @Nullable [] getByteData()
- Returns:
- the request's body byte array (only non-null if it was set this way)
-
getCompositeByteData
@Nullable @Nullable List<byte[]> getCompositeByteData()
- Returns:
- the request's body array of byte arrays (only non-null if it was set this way)
-
getStringData
@Nullable @Nullable String getStringData()
- Returns:
- the request's body string (only non-null if it was set this way)
-
getByteBufferData
@Nullable @Nullable ByteBuffer getByteBufferData()
- Returns:
- the request's body ByteBuffer (only non-null if it was set this way)
-
getByteBufData
@Nullable @Nullable io.netty.buffer.ByteBuf getByteBufData()
- Returns:
- the request's body ByteBuf (only non-null if it was set this way)
-
getStreamData
@Nullable @Nullable InputStream getStreamData()
- Returns:
- the request's body InputStream (only non-null if it was set this way)
-
getBodyGenerator
@Nullable @Nullable BodyGenerator getBodyGenerator()
- Returns:
- the request's body BodyGenerator (only non-null if it was set this way)
-
getVirtualHost
@Nullable @Nullable String getVirtualHost()
- Returns:
- the virtual host to connect to
-
getProxyServer
@Nullable @Nullable ProxyServer getProxyServer()
- Returns:
- the proxy server to be used to perform this request (overrides the one defined in config)
-
getRealm
@Nullable @Nullable Realm getRealm()
- Returns:
- the realm to be used to perform this request (overrides the one defined in config)
-
getFile
@Nullable @Nullable File getFile()
- Returns:
- the file to be uploaded
-
getFollowRedirect
@Nullable @Nullable Boolean getFollowRedirect()
- Returns:
- if this request is to follow redirects. Non null values means "override config value".
-
getRequestTimeout
Duration getRequestTimeout()
- Returns:
- the request timeout. Non zero values means "override config value".
-
getReadTimeout
Duration getReadTimeout()
- Returns:
- the read timeout. Non-zero values means "override config value".
-
getRangeOffset
long getRangeOffset()
- Returns:
- the range header value, or 0 is not set.
-
getCharset
@Nullable @Nullable Charset getCharset()
- Returns:
- the charset value used when decoding the request's body.
-
getChannelPoolPartitioning
ChannelPoolPartitioning getChannelPoolPartitioning()
- Returns:
- the strategy to compute ChannelPool's keys
-
getNameResolver
io.netty.resolver.NameResolver<InetAddress> getNameResolver()
- Returns:
- the NameResolver to be used to resolve hostnams's IP
-
toBuilder
default RequestBuilder toBuilder()
- Returns:
- a new request builder using this request as a prototype
-
-