Skip to content
Sharp

HTTP JSON APIs · interview question

In Java's HttpClient, which method converts a synchronous request into an asynchronous one?

Multiple choiceMediumchapter-11-curatedpremiumhttp-json-apisapi-versioning
Choose one answer
Answer and explanation

Correct answer

C. SendAsync

Why

The sendAsync method in Java's HttpClient allows you to perform an HTTP request asynchronously, which returns a CompletableFuture that you can use to handle the response once it is received.

Test yourself on HTTP JSON APIs

A free test with instant, explained results. No account needed.

Start free test
All HTTP JSON APIs questions →