Modifier and Type | Method and Description |
---|---|
WSRequest |
addCookie(Http.Cookie cookie)
Adds a cookie to the request
|
WSRequest |
addCookie(play.libs.ws.WSCookie cookie)
Adds a cookie to the request
|
WSRequest |
addCookies(play.libs.ws.WSCookie... cookies)
Sets several cookies on the request.
|
WSRequest |
addHeader(String name,
String value)
Adds a header to the request.
|
WSRequest |
addQueryParameter(String name,
String value)
Sets a query parameter with the given name, this can be called repeatedly.
|
CompletionStage<WSResponse> |
delete()
Perform a DELETE on the request asynchronously.
|
CompletionStage<WSResponse> |
execute()
Execute an arbitrary method on the request asynchronously.
|
CompletionStage<WSResponse> |
execute(String method)
Execute an arbitrary method on the request asynchronously.
|
CompletionStage<WSResponse> |
get()
Perform a GET on the request asynchronously.
|
Optional<play.libs.ws.WSAuthInfo> |
getAuth() |
Optional<play.libs.ws.BodyWritable> |
getBody() |
Optional<play.libs.ws.WSSignatureCalculator> |
getCalculator() |
Optional<String> |
getContentType() |
Optional<Boolean> |
getFollowRedirects() |
Optional<String> |
getHeader(String name) |
Map<String,List<String>> |
getHeaders() |
List<String> |
getHeaderValues(String name) |
Map<String,List<String>> |
getQueryParameters() |
Optional<Duration> |
getRequestTimeout() |
String |
getUrl() |
CompletionStage<WSResponse> |
head()
Perform a HEAD on the request asynchronously.
|
CompletionStage<WSResponse> |
options()
Perform an OPTIONS on the request asynchronously.
|
CompletionStage<WSResponse> |
patch(play.libs.ws.BodyWritable body)
Perform a PATCH on the request asynchronously.
|
CompletionStage<WSResponse> |
patch(Document doc)
Perform a PATCH on the request asynchronously.
|
CompletionStage<WSResponse> |
patch(File file)
Perform a PATCH on the request asynchronously.
|
CompletionStage<WSResponse> |
patch(InputStream inputStream)
Deprecated.
|
CompletionStage<WSResponse> |
patch(com.fasterxml.jackson.databind.JsonNode jsonNode)
Perform a PATCH on the request asynchronously.
|
CompletionStage<WSResponse> |
patch(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
Perform a PATCH on the request asynchronously.
|
CompletionStage<WSResponse> |
patch(String string)
Perform a PATCH on the request asynchronously.
|
CompletionStage<WSResponse> |
post(play.libs.ws.BodyWritable body)
Perform a POST on the request asynchronously.
|
CompletionStage<WSResponse> |
post(Document doc)
Perform a POST on the request asynchronously.
|
CompletionStage<WSResponse> |
post(File file)
Perform a POST on the request asynchronously.
|
CompletionStage<WSResponse> |
post(InputStream is)
Deprecated.
|
CompletionStage<WSResponse> |
post(com.fasterxml.jackson.databind.JsonNode json)
Perform a POST on the request asynchronously.
|
CompletionStage<WSResponse> |
post(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
Perform a POST on the request asynchronously.
|
CompletionStage<WSResponse> |
post(String string)
Perform a POST on the request asynchronously.
|
CompletionStage<WSResponse> |
put(play.libs.ws.BodyWritable body)
Perform a PUT on the request asynchronously.
|
CompletionStage<WSResponse> |
put(Document doc)
Perform a PUT on the request asynchronously.
|
CompletionStage<WSResponse> |
put(File file)
Perform a PUT on the request asynchronously.
|
CompletionStage<WSResponse> |
put(InputStream is)
Deprecated.
|
CompletionStage<WSResponse> |
put(com.fasterxml.jackson.databind.JsonNode json)
Perform a PUT on the request asynchronously.
|
CompletionStage<WSResponse> |
put(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
Perform a PUT on the request asynchronously.
|
CompletionStage<WSResponse> |
put(String string)
Perform a PUT on the request asynchronously.
|
WSRequest |
setAuth(String userInfo)
Sets the authentication header for the current request using BASIC authentication.
|
WSRequest |
setAuth(String username,
String password)
Sets the authentication header for the current request using BASIC authentication.
|
WSRequest |
setAuth(String username,
String password,
play.libs.ws.WSAuthScheme scheme)
Sets the authentication header for the current request.
|
play.libs.ws.StandaloneWSRequest |
setAuth(play.libs.ws.WSAuthInfo authInfo) |
WSRequest |
setBody(play.libs.ws.BodyWritable bodyWritable)
Set the body this request should use.
|
WSRequest |
setBody(File file)
Set the body this request should use.
|
WSRequest |
setBody(InputStream is)
Deprecated.
|
WSRequest |
setBody(com.fasterxml.jackson.databind.JsonNode json)
Set the body this request should use.
|
<U> WSRequest |
setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> source)
Set the body this request should use.
|
WSRequest |
setBody(String string)
Set the body this request should use.
|
WSRequest |
setContentType(String contentType)
Set the content type.
|
WSRequest |
setCookies(List<play.libs.ws.WSCookie> cookies)
Sets all the cookies on the request.
|
WSRequest |
setFollowRedirects(boolean followRedirects)
Sets whether redirects (301, 302) should be followed automatically.
|
WSRequest |
setHeader(String name,
String value)
Deprecated.
use addHeader(name, value)
|
WSRequest |
setHeaders(Map<String,List<String>> headers)
Sets all of the headers on the request.
|
WSRequest |
setMethod(String method)
Sets the HTTP method this request should use, where the no args execute() method is invoked.
|
WSRequest |
setQueryParameter(String name,
String value)
Deprecated.
Use addQueryParameter
|
WSRequest |
setQueryString(Map<String,List<String>> params)
Sets the query string to query.
|
WSRequest |
setQueryString(String query)
Sets the query string to query.
|
WSRequest |
setRequestFilter(play.libs.ws.WSRequestFilter filter)
Adds a request filter.
|
WSRequest |
setRequestTimeout(Duration timeout)
Sets the request timeout in milliseconds.
|
WSRequest |
setRequestTimeout(long timeout)
Deprecated.
|
play.libs.ws.StandaloneWSRequest |
setUrl(String url) |
WSRequest |
setVirtualHost(String virtualHost)
Sets the virtual host as a "hostname:port" string.
|
WSRequest |
sign(play.libs.ws.WSSignatureCalculator calculator)
Sets an (OAuth) signature calculator.
|
CompletionStage<WSResponse> |
stream()
Execute this request and stream the response body.
|
public CompletionStage<WSResponse> get()
WSRequest
public CompletionStage<WSResponse> patch(play.libs.ws.BodyWritable body)
WSRequest
public CompletionStage<WSResponse> patch(String string)
WSRequest
public CompletionStage<WSResponse> patch(com.fasterxml.jackson.databind.JsonNode jsonNode)
WSRequest
public CompletionStage<WSResponse> patch(Document doc)
WSRequest
@Deprecated public CompletionStage<WSResponse> patch(InputStream inputStream)
WSRequest
public CompletionStage<WSResponse> patch(File file)
WSRequest
public CompletionStage<WSResponse> patch(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
WSRequest
public CompletionStage<WSResponse> post(play.libs.ws.BodyWritable body)
WSRequest
public CompletionStage<WSResponse> post(String string)
WSRequest
public CompletionStage<WSResponse> post(com.fasterxml.jackson.databind.JsonNode json)
WSRequest
public CompletionStage<WSResponse> post(Document doc)
WSRequest
@Deprecated public CompletionStage<WSResponse> post(InputStream is)
WSRequest
public CompletionStage<WSResponse> post(File file)
WSRequest
public CompletionStage<WSResponse> post(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
WSRequest
public CompletionStage<WSResponse> put(play.libs.ws.BodyWritable body)
WSRequest
public CompletionStage<WSResponse> put(String string)
WSRequest
public CompletionStage<WSResponse> put(com.fasterxml.jackson.databind.JsonNode json)
WSRequest
public CompletionStage<WSResponse> put(Document doc)
WSRequest
@Deprecated public CompletionStage<WSResponse> put(InputStream is)
WSRequest
public CompletionStage<WSResponse> put(File file)
WSRequest
public CompletionStage<WSResponse> put(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
WSRequest
public CompletionStage<WSResponse> delete()
WSRequest
public CompletionStage<WSResponse> head()
WSRequest
public CompletionStage<WSResponse> options()
WSRequest
public CompletionStage<WSResponse> execute(String method)
WSRequest
public CompletionStage<WSResponse> execute()
WSRequest
public CompletionStage<WSResponse> stream()
WSRequest
public WSRequest setMethod(String method)
WSRequest
public WSRequest setBody(play.libs.ws.BodyWritable bodyWritable)
WSRequest
public WSRequest setBody(String string)
WSRequest
public WSRequest setBody(com.fasterxml.jackson.databind.JsonNode json)
WSRequest
@Deprecated public WSRequest setBody(InputStream is)
WSRequest
public WSRequest setBody(File file)
WSRequest
public <U> WSRequest setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> source)
WSRequest
@Deprecated public WSRequest setHeader(String name, String value)
WSRequest
public WSRequest setHeaders(Map<String,List<String>> headers)
WSRequest
setHeaders
in interface play.libs.ws.StandaloneWSRequest
setHeaders
in interface WSRequest
headers
- the headerspublic WSRequest addHeader(String name, String value)
WSRequest
public WSRequest setQueryString(String query)
WSRequest
setQueryString
in interface play.libs.ws.StandaloneWSRequest
setQueryString
in interface WSRequest
query
- the fully formed query string@Deprecated public WSRequest setQueryParameter(String name, String value)
WSRequest
setQueryParameter
in interface WSRequest
name
- the query parameter namevalue
- the query parameter valuepublic WSRequest addQueryParameter(String name, String value)
WSRequest
addQueryParameter
in interface play.libs.ws.StandaloneWSRequest
addQueryParameter
in interface WSRequest
name
- the query parameter namevalue
- the query parameter valuepublic WSRequest setQueryString(Map<String,List<String>> params)
WSRequest
setQueryString
in interface play.libs.ws.StandaloneWSRequest
setQueryString
in interface WSRequest
params
- the query string parameterspublic play.libs.ws.StandaloneWSRequest setUrl(String url)
setUrl
in interface play.libs.ws.StandaloneWSRequest
public WSRequest addCookie(play.libs.ws.WSCookie cookie)
WSRequest
public WSRequest addCookie(Http.Cookie cookie)
WSRequest
public WSRequest addCookies(play.libs.ws.WSCookie... cookies)
WSRequest
addCookies
in interface play.libs.ws.StandaloneWSRequest
addCookies
in interface WSRequest
cookies
- the cookies.public WSRequest setCookies(List<play.libs.ws.WSCookie> cookies)
WSRequest
setCookies
in interface play.libs.ws.StandaloneWSRequest
setCookies
in interface WSRequest
cookies
- all the cookies.public WSRequest setAuth(String userInfo)
WSRequest
public WSRequest setAuth(String username, String password)
WSRequest
public WSRequest setAuth(String username, String password, play.libs.ws.WSAuthScheme scheme)
WSRequest
public play.libs.ws.StandaloneWSRequest setAuth(play.libs.ws.WSAuthInfo authInfo)
setAuth
in interface play.libs.ws.StandaloneWSRequest
public WSRequest sign(play.libs.ws.WSSignatureCalculator calculator)
WSRequest
public WSRequest setFollowRedirects(boolean followRedirects)
WSRequest
setFollowRedirects
in interface play.libs.ws.StandaloneWSRequest
setFollowRedirects
in interface WSRequest
followRedirects
- true if the request should follow redirectspublic WSRequest setVirtualHost(String virtualHost)
WSRequest
setVirtualHost
in interface play.libs.ws.StandaloneWSRequest
setVirtualHost
in interface WSRequest
virtualHost
- the virtual host@Deprecated public WSRequest setRequestTimeout(long timeout)
setRequestTimeout(Duration timeout)
WSRequest
setRequestTimeout
in interface WSRequest
timeout
- the request timeout in milliseconds. A value of -1 indicates an infinite request
timeout.public WSRequest setRequestTimeout(Duration timeout)
WSRequest
setRequestTimeout
in interface play.libs.ws.StandaloneWSRequest
setRequestTimeout
in interface WSRequest
timeout
- the request timeout in milliseconds. A value of -1 indicates an infinite request
timeout.public WSRequest setRequestFilter(play.libs.ws.WSRequestFilter filter)
WSRequest
setRequestFilter
in interface play.libs.ws.StandaloneWSRequest
setRequestFilter
in interface WSRequest
filter
- a transforming filter.public WSRequest setContentType(String contentType)
WSRequest
setContentType
in interface play.libs.ws.StandaloneWSRequest
setContentType
in interface WSRequest
contentType
- The content typepublic Optional<play.libs.ws.WSAuthInfo> getAuth()
getAuth
in interface play.libs.ws.StandaloneWSRequest
public Optional<play.libs.ws.BodyWritable> getBody()
getBody
in interface play.libs.ws.StandaloneWSRequest
public Optional<play.libs.ws.WSSignatureCalculator> getCalculator()
getCalculator
in interface play.libs.ws.StandaloneWSRequest
public Optional<String> getContentType()
getContentType
in interface play.libs.ws.StandaloneWSRequest
public Optional<Boolean> getFollowRedirects()
getFollowRedirects
in interface play.libs.ws.StandaloneWSRequest
public String getUrl()
public Map<String,List<String>> getHeaders()
getHeaders
in interface play.libs.ws.StandaloneWSRequest
getHeaders
in interface WSRequest
public List<String> getHeaderValues(String name)
getHeaderValues
in interface play.libs.ws.StandaloneWSRequest
public Optional<String> getHeader(String name)
getHeader
in interface play.libs.ws.StandaloneWSRequest
public Optional<Duration> getRequestTimeout()
getRequestTimeout
in interface play.libs.ws.StandaloneWSRequest
public Map<String,List<String>> getQueryParameters()
getQueryParameters
in interface play.libs.ws.StandaloneWSRequest
getQueryParameters
in interface WSRequest