An asynchronous REST client that leverages Netty for non-blocking IO
| Modifiers | Name | Description |
|---|---|---|
static class |
AsyncHttpBuilder.AsyncHttpClientInitializer |
Initializes the HTTP client channel |
static class |
AsyncHttpBuilder.HttpConnectionListener |
|
static class |
AsyncHttpBuilder.HttpResponseHandler |
| Type | Name and description |
|---|---|
java.nio.charset.Charset |
charset |
Configuration |
configuration |
| Constructor and description |
|---|
AsyncHttpBuilder
(Configuration configuration = new DefaultConfiguration()Constructs a new AsyncHttpBuilder instance for the given configuration |
| Type | Name and description |
|---|---|
protected NettyPromise<HttpClientResponse> |
buildPromise(io.netty.util.concurrent.Promise promise) |
protected io.netty.handler.ssl.SslContext |
buildSslContext(java.net.URI uriObject) |
protected io.netty.handler.ssl.SslContext |
buildSslContext(Configuration configuration)Builds an io.netty.handler.ssl.SslContext from the Configuration |
grails.async.Promise<HttpClientResponse> |
delete(java.lang.String uri, groovy.lang.Closure customizer = null)Executes a DELETE request to the given URI with an optional customizer |
protected io.netty.channel.ChannelFuture |
doConnect(java.net.URI uri, io.netty.handler.ssl.SslContext sslCtx) |
protected io.netty.channel.ChannelFuture |
doConnect(java.lang.String host, int port, io.netty.handler.ssl.SslContext sslCtx)Creates an initial connection to the given remote host |
protected io.netty.channel.ChannelFuture |
doConnect(io.netty.bootstrap.Bootstrap bootstrap, java.lang.String host, int port)Creates an initial connection with the given bootstrap and remote host |
protected NettyPromise<HttpClientResponse> |
doRequest(io.netty.handler.codec.http.HttpMethod httpMethod, groovy.lang.Closure customizer, java.lang.String uri) |
grails.async.Promise<HttpClientResponse> |
get(java.lang.String uri, groovy.lang.Closure customizer = null)Executes a GET request to the given URI with an optional customizer |
grails.async.Promise<HttpClientResponse> |
head(java.lang.String uri, groovy.lang.Closure customizer = null)Executes a HEAD request to the given URI with an optional customizer |
protected io.netty.util.concurrent.Promise |
newPromise(io.netty.channel.ChannelFuture channelFuture) |
grails.async.Promise<HttpClientResponse> |
options(java.lang.String uri, groovy.lang.Closure customizer = null)Executes a OPTIONS request to the given URI with an optional customizer |
grails.async.Promise<HttpClientResponse> |
patch(java.lang.String uri, groovy.lang.Closure customizer = null)Executes a PATCH request to the given URI with an optional customizer |
grails.async.Promise<HttpClientResponse> |
post(java.lang.String uri, groovy.lang.Closure customizer = null)Executes a POST request to the given URI with an optional customizer |
grails.async.Promise<HttpClientResponse> |
put(java.lang.String uri, groovy.lang.Closure customizer = null)Executes a PUT request to the given URI with an optional customizer |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructs a new AsyncHttpBuilder instance for the given configuration
configuration - The configurationBuilds an io.netty.handler.ssl.SslContext from the Configuration
configuration - The configuration instanceExecutes a DELETE request to the given URI with an optional customizer
uri - The URIcustomizer - The customizerCreates an initial connection to the given remote host
host - The hostport - The portsslCtx - The SslContext instanceCreates an initial connection with the given bootstrap and remote host
bootstrap - The bootstrap instancehost - The hostport - The portExecutes a GET request to the given URI with an optional customizer
uri - The URIcustomizer - The customizerExecutes a HEAD request to the given URI with an optional customizer
uri - The URIcustomizer - The customizerExecutes a OPTIONS request to the given URI with an optional customizer
uri - The URIcustomizer - The customizerExecutes a PATCH request to the given URI with an optional customizer
uri - The URIcustomizer - The customizerExecutes a POST request to the given URI with an optional customizer
uri - The URIcustomizer - The customizerExecutes a PUT request to the given URI with an optional customizer
uri - The URIcustomizer - The customizerGroovy Documentation