You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -172,7 +163,7 @@ Overview of response types for sync calls.
172
163
### HttpResponse BodyHandlers
173
164
174
165
JDK HttpClient provides a number of [BodyHandlers](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.BodyHandler.html)
175
-
including reactive Flowbased subscribers. With the `handler()` method we can use any of these or our own [`HttpResponse.BodyHandler`](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.BodyHandler.html)
166
+
including reactive Flow-based subscribers. With the `handler()` method we can use any of these or our own [`HttpResponse.BodyHandler`](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.BodyHandler.html)
176
167
implementation.
177
168
178
169
Refer to [HttpResponse.BodyHandlers](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.BodyHandlers.html)
@@ -198,8 +189,6 @@ When sending body content we can use:
198
189
- formParams() for url encoded form (`application/x-www-form-urlencoded`)
199
190
- Any [HttpRequest.BodyPublisher](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpRequest.BodyPublishers.html)
200
191
201
-
202
-
203
192
## Examples
204
193
205
194
#### GET as String
@@ -345,7 +334,7 @@ HttpResponse<Void> res = client.request()
345
334
assertThat(res.statusCode()).isEqualTo(201);
346
335
```
347
336
348
-
## Retry (Sync Requests Only)
337
+
## Retry
349
338
To add Retry funtionality, use `.retryHandler(yourhandler)` on the builder to provide your retry handler. The `RetryHandler` interface provides two methods, one for status exceptions (e.g. you get a 4xx/5xx from the server) and another for exceptions thrown by the underlying client (e.g. server times out or client couldn't send request). Here is example implementation of `RetryHandler`.
350
339
351
340
```
@@ -382,7 +371,7 @@ public final class ExampleRetry implements RetryHandler {
382
371
## Async processing
383
372
384
373
All async requests use JDK httpClient.sendAsync(...) returning CompletableFuture. Commonly the
385
-
`whenComplete()` callback will be used to process the async responses.
374
+
`whenComplete()` callback is used to process the async responses.
386
375
387
376
The `bean()`, `list()` and `stream()` responses throw a `HttpException` if the status code >= 300
388
377
(noting that by default redirects are followed apart for HTTPS to HTTP).
0 commit comments