public interface WSClient extends Closeable
Most of the time you will access this through dependency injection, i.e.
import javax.inject.Inject;
import play.libs.ws.*;
import java.util.concurrent.CompletionStage;
public class MyService {
@Inject WSClient ws;
// ...
}
Please see https://www.playframework.com/documentation/latest/JavaWS for more details.Modifier and Type | Method and Description |
---|---|
play.api.libs.ws.WSClient |
asScala() |
void |
close()
Closes this client, and releases underlying resources.
|
Object |
getUnderlying()
The underlying implementation of the client, if any.
|
WSRequest |
url(String url)
Returns a WSRequest object representing the URL.
|
Object getUnderlying()
play.api.libs.ws.WSClient asScala()
WSRequest url(String url)
Promise<WSResponse>
.url
- the URL to requestvoid close() throws IOException
Use this for manually instantiated clients.
close
in interface AutoCloseable
close
in interface Closeable
IOException