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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description InetAddress
getAddress()
BodyGenerator
getBodyGenerator()
List<Part>
getBodyParts()
ByteBuffer
getByteBufferData()
byte[]
getByteData()
ChannelPoolPartitioning
getChannelPoolPartitioning()
Charset
getCharset()
List<byte[]>
getCompositeByteData()
List<io.netty.handler.codec.http.cookie.Cookie>
getCookies()
File
getFile()
Boolean
getFollowRedirect()
List<Param>
getFormParams()
io.netty.handler.codec.http.HttpHeaders
getHeaders()
InetAddress
getLocalAddress()
String
getMethod()
io.netty.resolver.NameResolver<InetAddress>
getNameResolver()
ProxyServer
getProxyServer()
List<Param>
getQueryParams()
long
getRangeOffset()
Duration
getReadTimeout()
Realm
getRealm()
Duration
getRequestTimeout()
InputStream
getStreamData()
String
getStringData()
Uri
getUri()
String
getUrl()
String
getVirtualHost()
default RequestBuilder
toBuilder()
-
-
-
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
InetAddress getAddress()
- Returns:
- the InetAddress to be used to bypass uri's hostname resolution
-
getLocalAddress
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[] getByteData()
- Returns:
- the request's body byte array (only non null if it was set this way)
-
getCompositeByteData
List<byte[]> getCompositeByteData()
- Returns:
- the request's body array of byte arrays (only non null if it was set this way)
-
getStringData
String getStringData()
- Returns:
- the request's body string (only non null if it was set this way)
-
getByteBufferData
ByteBuffer getByteBufferData()
- Returns:
- the request's body ByteBuffer (only non null if it was set this way)
-
getStreamData
InputStream getStreamData()
- Returns:
- the request's body InputStream (only non null if it was set this way)
-
getBodyGenerator
BodyGenerator getBodyGenerator()
- Returns:
- the request's body BodyGenerator (only non null if it was set this way)
-
getVirtualHost
String getVirtualHost()
- Returns:
- the virtual host to connect to
-
getProxyServer
ProxyServer getProxyServer()
- Returns:
- the proxy server to be used to perform this request (overrides the one defined in config)
-
getRealm
Realm getRealm()
- Returns:
- the realm to be used to perform this request (overrides the one defined in config)
-
getFile
File getFile()
- Returns:
- the file to be uploaded
-
getFollowRedirect
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
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
-
-