Package | Description |
---|---|
ratpack.http.client |
The HTTP client.
|
ratpack.sse |
Support for Server Sent Events.
|
ratpack.test.http |
Test fixtures that provide HTTP client interfaces to applications under test.
|
Modifier and Type | Method and Description |
---|---|
default RequestSpec |
RequestSpec.basicAuth(java.lang.String username,
java.lang.String password)
Adds the appropriate header for HTTP Basic authentication with the given username and password.
|
RequestSpec |
RequestSpec.body(Action<? super RequestSpec.Body> action)
Executes the given action with the
request body . |
RequestSpec |
RequestSpec.connectTimeout(java.time.Duration duration)
Sets the socket connection timeout.
|
default RequestSpec |
RequestSpec.connectTimeoutSeconds(int seconds)
Deprecated.
since 1.4, use
connectTimeout(Duration) |
RequestSpec |
RequestSpec.decompressResponse(boolean shouldDecompress)
Enables automatic decompression of the response.
|
default RequestSpec |
RequestSpec.delete()
Specifies to use the DELETE request method.
|
default RequestSpec |
RequestSpec.get()
Specifies to use the GET request method.
|
default RequestSpec |
RequestSpec.head()
Specifies to use the HEAD request method.
|
RequestSpec |
RequestSpec.headers(Action<? super MutableHeaders> action)
This method can be used to buffer changes to the headers.
|
RequestSpec |
RequestSpec.maxContentLength(int numBytes)
The maximum response length to accept.
|
RequestSpec |
RequestSpec.method(HttpMethod method)
Specifies the request method.
|
default RequestSpec |
RequestSpec.method(java.lang.String method)
Specifies the request method.
|
RequestSpec |
RequestSpec.onRedirect(Function<? super ReceivedResponse,Action<? super RequestSpec>> function)
Specifies a function to invoke when a redirectable response is received.
|
default RequestSpec |
RequestSpec.options()
Specifies to use the OPTIONS request method.
|
default RequestSpec |
RequestSpec.patch()
Specifies to use the PATCH request method.
|
default RequestSpec |
RequestSpec.post()
Specifies to use the POST request method.
|
default RequestSpec |
RequestSpec.put()
Specifies to use the PUT request method.
|
RequestSpec |
RequestSpec.readTimeout(java.time.Duration duration)
Sets the socket read timeout.
|
default RequestSpec |
RequestSpec.readTimeoutSeconds(int seconds)
Deprecated.
since 1.4, use
readTimeout(Duration) |
RequestSpec |
RequestSpec.redirects(int maxRedirects)
The maximum number of redirects to automatically follow, before simply returning the redirect response.
|
RequestSpec |
RequestSpec.responseMaxChunkSize(int numBytes)
The max size of the chunks to emit when reading a response as a stream.
|
default RequestSpec |
RequestSpec.sslContext(Factory<javax.net.ssl.SSLContext> factory)
Deprecated.
since 1.5, no replacement.
|
RequestSpec |
RequestSpec.sslContext(io.netty.handler.ssl.SslContext sslContext)
Sets the
SslContext used for client and server SSL authentication. |
RequestSpec |
RequestSpec.sslContext(javax.net.ssl.SSLContext sslContext)
Deprecated.
since 1.5, use
sslContext(SslContext) |
Modifier and Type | Method and Description |
---|---|
Promise<ReceivedResponse> |
HttpClient.get(java.net.URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a GET HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec, but the method will be defaulted to a GET.
|
RequestSpec |
RequestSpec.onRedirect(Function<? super ReceivedResponse,Action<? super RequestSpec>> function)
Specifies a function to invoke when a redirectable response is received.
|
Promise<ReceivedResponse> |
HttpClient.post(java.net.URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a POST HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec, but the method will be defaulted to a POST.
|
Promise<ReceivedResponse> |
HttpClient.request(java.net.URI uri,
Action<? super RequestSpec> action)
An asynchronous method to do a HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec.
|
HttpClientSpec |
HttpClientSpec.requestIntercept(Action<? super RequestSpec> interceptor)
Add an interceptor for all requests handled by this client.
|
Promise<StreamedResponse> |
HttpClient.requestStream(java.net.URI uri,
Action<? super RequestSpec> requestConfigurer)
An asynchronous method to do a HTTP request, the URL and all details of the request are configured by the Action acting on the RequestSpec,
the received response content will be streamed.
|
Modifier and Type | Method and Description |
---|---|
Promise<TransformablePublisher<Event<?>>> |
ServerSentEventStreamClient.request(java.net.URI uri,
Action<? super RequestSpec> action) |
Modifier and Type | Method and Description |
---|---|
ReceivedResponse |
TestHttpClient.request(Action<? super RequestSpec> requestAction)
Executes the request as specified by the provided
RequestSpec . |
ReceivedResponse |
TestHttpClient.request(java.lang.String path,
Action<? super RequestSpec> requestAction)
Executes the request as specified by the provided
RequestSpec against the provided path. |
TestHttpClient |
TestHttpClient.requestSpec(Action<? super RequestSpec> requestAction) |
static TestHttpClient |
TestHttpClient.testHttpClient(ApplicationUnderTest applicationUnderTest,
Action<? super RequestSpec> requestConfigurer)
A method to create an instance of the default implementation of TestHttpClient.
|