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(java.lang.String name,
java.lang.String value)
Adds a header to the request.
|
WSRequest |
addQueryParameter(java.lang.String name,
java.lang.String value)
Sets a query parameter with the given name, this can be called repeatedly.
|
play.libs.ws.WSCookie |
asCookie(Http.Cookie cookie) |
java.util.concurrent.CompletionStage<WSResponse> |
delete()
Perform a DELETE on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
execute()
Execute an arbitrary method on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
execute(java.lang.String method)
Execute an arbitrary method on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
get()
Perform a GET on the request asynchronously.
|
play.libs.ws.WSSignatureCalculator |
getCalculator() |
java.lang.String |
getContentType() |
boolean |
getFollowRedirects()
If the
WSRequest.setFollowRedirects(boolean) method has been called, then returns true. |
java.util.Optional<java.lang.String> |
getHeader(java.lang.String name) |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getHeaders() |
java.util.List<java.lang.String> |
getHeaderValues(java.lang.String name) |
java.lang.String |
getPassword() |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getQueryParameters() |
long |
getRequestTimeout()
Deprecated.
|
java.time.Duration |
getRequestTimeoutDuration()
Gets the original request timeout.
|
play.libs.ws.WSAuthScheme |
getScheme() |
java.lang.String |
getUrl() |
java.lang.String |
getUsername() |
java.util.concurrent.CompletionStage<WSResponse> |
head()
Perform a HEAD on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
options()
Perform an OPTIONS on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(play.libs.ws.BodyWritable body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(org.w3c.dom.Document doc)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(java.io.File file)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(java.io.InputStream inputStream)
Deprecated.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(com.fasterxml.jackson.databind.JsonNode jsonNode)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.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.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(java.lang.String string)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(play.libs.ws.BodyWritable body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(org.w3c.dom.Document doc)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(java.io.File file)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(java.io.InputStream is)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(com.fasterxml.jackson.databind.JsonNode json)
Perform a POST on the request asynchronously.
|
java.util.concurrent.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.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(java.lang.String string)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(play.libs.ws.BodyWritable body)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(org.w3c.dom.Document doc)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(java.io.File file)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(java.io.InputStream is)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(com.fasterxml.jackson.databind.JsonNode json)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.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.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(java.lang.String string)
Perform a PUT on the request asynchronously.
|
WSRequest |
setAuth(java.lang.String userInfo)
Sets the authentication header for the current request using BASIC authentication.
|
WSRequest |
setAuth(java.lang.String username,
java.lang.String password)
Sets the authentication header for the current request using BASIC authentication.
|
WSRequest |
setAuth(java.lang.String username,
java.lang.String password,
play.libs.ws.WSAuthScheme scheme)
Sets the authentication header for the current request.
|
WSRequest |
setBody(play.libs.ws.BodyWritable bodyWritable)
Set the body this request should use.
|
WSRequest |
setBody(java.io.File file)
Set the body this request should use.
|
WSRequest |
setBody(java.io.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(java.lang.String string)
Set the body this request should use.
|
WSRequest |
setContentType(java.lang.String contentType)
Set the content type.
|
WSRequest |
setCookies(java.util.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(java.lang.String name,
java.lang.String value)
Deprecated.
use addHeader(name, value)
|
WSRequest |
setHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
Sets all of the headers on the request.
|
WSRequest |
setMethod(java.lang.String method)
Sets the HTTP method this request should use, where the no args execute() method is invoked.
|
WSRequest |
setQueryParameter(java.lang.String name,
java.lang.String value)
Deprecated.
Use addQueryParameter
|
WSRequest |
setQueryString(java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
Sets the query string to query.
|
WSRequest |
setQueryString(java.lang.String query)
Sets the query string to query.
|
WSRequest |
setRequestFilter(play.libs.ws.WSRequestFilter filter)
Adds a request filter.
|
WSRequest |
setRequestTimeout(java.time.Duration timeout)
Sets the request timeout in milliseconds.
|
WSRequest |
setRequestTimeout(long timeout)
Deprecated.
|
WSRequest |
setVirtualHost(java.lang.String virtualHost)
Sets the virtual host as a "hostname:port" string.
|
WSRequest |
sign(play.libs.ws.WSSignatureCalculator calculator)
Sets an (OAuth) signature calculator.
|
java.util.concurrent.CompletionStage<WSResponse> |
stream()
Execute this request and stream the response body.
|
public java.util.concurrent.CompletionStage<WSResponse> get()
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> patch(play.libs.ws.BodyWritable body)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> patch(java.lang.String string)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> patch(com.fasterxml.jackson.databind.JsonNode jsonNode)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> patch(org.w3c.dom.Document doc)
WSRequest
@Deprecated public java.util.concurrent.CompletionStage<WSResponse> patch(java.io.InputStream inputStream)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> patch(java.io.File file)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> patch(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> post(play.libs.ws.BodyWritable body)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> post(java.lang.String string)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> post(com.fasterxml.jackson.databind.JsonNode json)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> post(org.w3c.dom.Document doc)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> post(java.io.InputStream is)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> post(java.io.File file)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> post(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> put(play.libs.ws.BodyWritable body)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> put(java.lang.String string)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> put(com.fasterxml.jackson.databind.JsonNode json)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> put(org.w3c.dom.Document doc)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> put(java.io.InputStream is)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> put(java.io.File file)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> put(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> bodyPartSource)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> delete()
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> head()
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> options()
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> execute(java.lang.String method)
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> execute()
WSRequest
public java.util.concurrent.CompletionStage<WSResponse> stream()
WSRequest
public WSRequest setMethod(java.lang.String method)
WSRequest
public WSRequest setBody(play.libs.ws.BodyWritable bodyWritable)
WSRequest
public WSRequest setBody(java.lang.String string)
WSRequest
public WSRequest setBody(com.fasterxml.jackson.databind.JsonNode json)
WSRequest
@Deprecated public WSRequest setBody(java.io.InputStream is)
WSRequest
public WSRequest setBody(java.io.File file)
WSRequest
public <U> WSRequest setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> source)
WSRequest
@Deprecated public WSRequest setHeader(java.lang.String name, java.lang.String value)
WSRequest
public WSRequest setHeaders(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
WSRequest
setHeaders
in interface play.libs.ws.StandaloneWSRequest
setHeaders
in interface WSRequest
headers
- the headerspublic WSRequest addHeader(java.lang.String name, java.lang.String value)
WSRequest
public WSRequest setQueryString(java.lang.String query)
WSRequest
setQueryString
in interface play.libs.ws.StandaloneWSRequest
setQueryString
in interface WSRequest
query
- the fully formed query string@Deprecated public WSRequest setQueryParameter(java.lang.String name, java.lang.String value)
WSRequest
setQueryParameter
in interface WSRequest
name
- the query parameter namevalue
- the query parameter valuepublic WSRequest addQueryParameter(java.lang.String name, java.lang.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(java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
WSRequest
setQueryString
in interface play.libs.ws.StandaloneWSRequest
setQueryString
in interface WSRequest
params
- the query string parameterspublic WSRequest addCookie(play.libs.ws.WSCookie cookie)
WSRequest
public WSRequest addCookie(Http.Cookie cookie)
WSRequest
public play.libs.ws.WSCookie asCookie(Http.Cookie cookie)
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(java.util.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(java.lang.String userInfo)
WSRequest
public WSRequest setAuth(java.lang.String username, java.lang.String password)
WSRequest
public WSRequest setAuth(java.lang.String username, java.lang.String password, play.libs.ws.WSAuthScheme scheme)
WSRequest
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(java.lang.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(java.time.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(java.lang.String contentType)
WSRequest
setContentType
in interface play.libs.ws.StandaloneWSRequest
setContentType
in interface WSRequest
contentType
- The content typepublic java.lang.String getUrl()
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
getHeaders
in interface play.libs.ws.StandaloneWSRequest
getHeaders
in interface WSRequest
public java.util.List<java.lang.String> getHeaderValues(java.lang.String name)
getHeaderValues
in interface play.libs.ws.StandaloneWSRequest
public java.util.Optional<java.lang.String> getHeader(java.lang.String name)
getHeader
in interface play.libs.ws.StandaloneWSRequest
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getQueryParameters()
getQueryParameters
in interface play.libs.ws.StandaloneWSRequest
getQueryParameters
in interface WSRequest
public java.lang.String getUsername()
getUsername
in interface play.libs.ws.StandaloneWSRequest
getUsername
in interface WSRequest
public java.lang.String getPassword()
getPassword
in interface play.libs.ws.StandaloneWSRequest
getPassword
in interface WSRequest
public play.libs.ws.WSAuthScheme getScheme()
public play.libs.ws.WSSignatureCalculator getCalculator()
getCalculator
in interface play.libs.ws.StandaloneWSRequest
getCalculator
in interface WSRequest
@Deprecated public long getRequestTimeout()
getRequestTimeoutDuration()
WSRequest
getRequestTimeout
in interface WSRequest
public java.time.Duration getRequestTimeoutDuration()
WSRequest
getRequestTimeoutDuration
in interface play.libs.ws.StandaloneWSRequest
getRequestTimeoutDuration
in interface WSRequest
public boolean getFollowRedirects()
WSRequest
WSRequest.setFollowRedirects(boolean)
method has been called, then returns true.getFollowRedirects
in interface play.libs.ws.StandaloneWSRequest
getFollowRedirects
in interface WSRequest
public java.lang.String getContentType()
getContentType
in interface play.libs.ws.StandaloneWSRequest