equal
deleted
inserted
replaced
456 * method. |
456 * method. |
457 * |
457 * |
458 * @implNote When automatic redirection occurs, the request method of the |
458 * @implNote When automatic redirection occurs, the request method of the |
459 * redirected request may be modified depending on the specific {@code 30X} |
459 * redirected request may be modified depending on the specific {@code 30X} |
460 * status code, as specified in <a href="https://tools.ietf.org/html/rfc7231"> |
460 * status code, as specified in <a href="https://tools.ietf.org/html/rfc7231"> |
461 * RFC 7231</a>. In addition, the {@code 301} and {@code 302} status codes, |
461 * RFC 7231</a>. In addition, the {@code 301} and {@code 302} status codes |
462 * cause a {@code POST} request to be converted to a {@code GET} in the |
462 * cause a {@code POST} request to be converted to a {@code GET} in the |
463 * redirected request. |
463 * redirected request. |
464 * |
464 * |
465 * @since 11 |
465 * @since 11 |
466 */ |
466 */ |
492 * @param request the request |
492 * @param request the request |
493 * @param responseBodyHandler the response body handler |
493 * @param responseBodyHandler the response body handler |
494 * @return the response |
494 * @return the response |
495 * @throws IOException if an I/O error occurs when sending or receiving |
495 * @throws IOException if an I/O error occurs when sending or receiving |
496 * @throws InterruptedException if the operation is interrupted |
496 * @throws InterruptedException if the operation is interrupted |
497 * @throws IllegalArgumentException if the request method is not supported |
497 * @throws IllegalArgumentException if the {@code request} argument is not |
|
498 * a request that could have been validly built as specified by {@link |
|
499 * HttpRequest.Builder HttpRequest.Builder}. |
498 * @throws SecurityException If a security manager has been installed |
500 * @throws SecurityException If a security manager has been installed |
499 * and it denies {@link java.net.URLPermission access} to the |
501 * and it denies {@link java.net.URLPermission access} to the |
500 * URL in the given request, or proxy if one is configured. |
502 * URL in the given request, or proxy if one is configured. |
501 * See <a href="#securitychecks">security checks</a> for further |
503 * See <a href="#securitychecks">security checks</a> for further |
502 * information. |
504 * information. |
513 * |
515 * |
514 * @param <T> the response body type |
516 * @param <T> the response body type |
515 * @param request the request |
517 * @param request the request |
516 * @param responseBodyHandler the response body handler |
518 * @param responseBodyHandler the response body handler |
517 * @return a {@code CompletableFuture<HttpResponse<T>>} |
519 * @return a {@code CompletableFuture<HttpResponse<T>>} |
|
520 * @throws IllegalArgumentException if the {@code request} argument is not |
|
521 * a request that could have been validly built as specified by {@link |
|
522 * HttpRequest.Builder HttpRequest.Builder}. |
518 */ |
523 */ |
519 public abstract <T> CompletableFuture<HttpResponse<T>> |
524 public abstract <T> CompletableFuture<HttpResponse<T>> |
520 sendAsync(HttpRequest request, |
525 sendAsync(HttpRequest request, |
521 BodyHandler<T> responseBodyHandler); |
526 BodyHandler<T> responseBodyHandler); |
522 |
527 |
545 * @param <T> the response body type |
550 * @param <T> the response body type |
546 * @param request the request |
551 * @param request the request |
547 * @param responseBodyHandler the response body handler |
552 * @param responseBodyHandler the response body handler |
548 * @param pushPromiseHandler push promise handler, may be null |
553 * @param pushPromiseHandler push promise handler, may be null |
549 * @return a {@code CompletableFuture<HttpResponse<T>>} |
554 * @return a {@code CompletableFuture<HttpResponse<T>>} |
550 * @throws IllegalArgumentException if the request method is not supported |
555 * @throws IllegalArgumentException if the {@code request} argument is not |
|
556 * a request that could have been validly built as specified by {@link |
|
557 * HttpRequest.Builder HttpRequest.Builder}. |
551 */ |
558 */ |
552 public abstract <T> CompletableFuture<HttpResponse<T>> |
559 public abstract <T> CompletableFuture<HttpResponse<T>> |
553 sendAsync(HttpRequest request, |
560 sendAsync(HttpRequest request, |
554 BodyHandler<T> responseBodyHandler, |
561 BodyHandler<T> responseBodyHandler, |
555 PushPromiseHandler<T> pushPromiseHandler); |
562 PushPromiseHandler<T> pushPromiseHandler); |