# Uses of Interface
java.net.http.HttpResponse

Packages that use HttpResponse
Package
Description
java.net.http
HTTP Client and WebSocket APIs

- ## Uses of HttpResponse in java.net.http

  Methods in java.net.http that return HttpResponse
  Modifier and Type
  Method
  Description
  `HttpResponse<?>`
  WebSocketHandshakeException.`getResponse()`
  Returns the server's counterpart of the opening handshake.
  `abstract <T> HttpResponse<T>`
  HttpClient.`send(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler)`
  Sends the given request using this client, blocking if necessary to get the response.
  Methods in java.net.http that return types with arguments of type HttpResponse
  Modifier and Type
  Method
  Description
  `Optional<HttpResponse<T>>`
  HttpResponse.`previousResponse()`
  Returns an `Optional` containing the previous intermediate response if one was received.
  `abstract <T> CompletableFuture<HttpResponse<T>>`
  HttpClient.`sendAsync(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler)`
  Sends the given request asynchronously using this client with the given response body handler.
  `abstract <T> CompletableFuture<HttpResponse<T>>`
  HttpClient.`sendAsync(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler, HttpResponse.PushPromiseHandler<T> pushPromiseHandler)`
  Sends the given request asynchronously using this client with the given response body handler and push promise handler.
  Method parameters in java.net.http with type arguments of type HttpResponse
  Modifier and Type
  Method
  Description
  `default void`
  HttpResponse.PushPromiseHandler.`applyPushPromise(HttpRequest initiatingRequest, HttpRequest pushPromiseRequest, HttpResponse.PushPromiseHandler.PushId pushid, Function<HttpResponse.BodyHandler<T>, CompletableFuture<HttpResponse<T>>> acceptor)`
  Notification of the first occurrence of an HTTP/3 incoming push promise.
  `void`
  HttpResponse.PushPromiseHandler.`applyPushPromise(HttpRequest initiatingRequest, HttpRequest pushPromiseRequest, Function<HttpResponse.BodyHandler<T>, CompletableFuture<HttpResponse<T>>> acceptor)`
  Notification of an incoming push promise.
  `static <T> HttpResponse.PushPromiseHandler<T>`
  HttpResponse.PushPromiseHandler.`of(Function<HttpRequest, HttpResponse.BodyHandler<T>> pushPromiseHandler, ConcurrentMap<HttpRequest, CompletableFuture<HttpResponse<T>>> pushPromisesMap)`
  Returns a push promise handler that accumulates push promises, and their responses, into the given map.
  Constructors in java.net.http with parameters of type HttpResponse
  Modifier
  Constructor
  Description
  ``
  `WebSocketHandshakeException(HttpResponse<?> response)`
  Constructs a `WebSocketHandshakeException` with the given `HttpResponse`.