equal
deleted
inserted
replaced
56 import jdk.incubator.http.internal.ResponseSubscribers; |
56 import jdk.incubator.http.internal.ResponseSubscribers; |
57 import static jdk.incubator.http.internal.common.Utils.charsetFrom; |
57 import static jdk.incubator.http.internal.common.Utils.charsetFrom; |
58 |
58 |
59 /** |
59 /** |
60 * Represents a response to a {@link HttpRequest}. |
60 * Represents a response to a {@link HttpRequest}. |
61 * {@Incubating} |
|
62 * |
61 * |
63 * <p> A {@code HttpResponse} is available when the response status code and |
62 * <p> A {@code HttpResponse} is available when the response status code and |
64 * headers have been received, and typically after the response body has also |
63 * headers have been received, and typically after the response body has also |
65 * been received. This depends on the response body handler provided when |
64 * been received. This depends on the response body handler provided when |
66 * sending the request. In all cases, the response body handler is invoked |
65 * sending the request. In all cases, the response body handler is invoked |
176 } |
175 } |
177 |
176 |
178 |
177 |
179 /** |
178 /** |
180 * A handler for response bodies. |
179 * A handler for response bodies. |
181 * {@Incubating} |
|
182 * |
180 * |
183 * <p> This is a function that takes two parameters: the response status code, |
181 * <p> This is a function that takes two parameters: the response status code, |
184 * and the response headers, and which returns a {@linkplain BodySubscriber}. |
182 * and the response headers, and which returns a {@linkplain BodySubscriber}. |
185 * The function is always called just before the response body is read. Its |
183 * The function is always called just before the response body is read. Its |
186 * implementation may examine the status code or headers and must decide, |
184 * implementation may examine the status code or headers and must decide, |
750 } |
748 } |
751 } |
749 } |
752 |
750 |
753 /** |
751 /** |
754 * A subscriber for response bodies. |
752 * A subscriber for response bodies. |
755 * {@Incubating} |
|
756 * |
753 * |
757 * <p> The object acts as a {@link Flow.Subscriber}<{@link List}<{@link |
754 * <p> The object acts as a {@link Flow.Subscriber}<{@link List}<{@link |
758 * ByteBuffer}>> to the HTTP client implementation, which publishes |
755 * ByteBuffer}>> to the HTTP client implementation, which publishes |
759 * unmodifiable lists of read-only ByteBuffers containing the response body. |
756 * unmodifiable lists of read-only ByteBuffers containing the response body. |
760 * The Flow of data, as well as the order of ByteBuffers in the Flow lists, |
757 * The Flow of data, as well as the order of ByteBuffers in the Flow lists, |