199 * code and headers, before the actual response body is received, and is |
199 * code and headers, before the actual response body is received, and is |
200 * responsible for creating the response {@link BodySubscriber |
200 * responsible for creating the response {@link BodySubscriber |
201 * BodySubscriber}. The {@code BodySubscriber} consumes the actual response |
201 * BodySubscriber}. The {@code BodySubscriber} consumes the actual response |
202 * body bytes and, typically, converts them into a higher-level Java type. |
202 * body bytes and, typically, converts them into a higher-level Java type. |
203 * |
203 * |
204 * <p> A {@code BodyHandler} is a function that takes a {@link ResponseInfo} |
204 * <p> A {@code BodyHandler} is a function that takes a {@link ResponseInfo |
205 * object; and which returns a |
205 * ResponseInfo} object; and which returns a {@code BodySubscriber}. The |
206 * {@code BodySubscriber}. The {@code BodyHandler} is invoked when the |
206 * {@code BodyHandler} is invoked when the response status code and headers |
207 * response status code and headers are available, but before the response |
207 * are available, but before the response body bytes are received. |
208 * body bytes are received. |
|
209 * |
208 * |
210 * <p> The following example uses one of the {@linkplain BodyHandlers |
209 * <p> The following example uses one of the {@linkplain BodyHandlers |
211 * predefined body handlers} that always process the response body in the |
210 * predefined body handlers} that always process the response body in the |
212 * same way ( streams the response body to a file ). |
211 * same way ( streams the response body to a file ). |
213 * |
212 * |