public interface WSRequest extends StandaloneWSRequest
| Modifier and Type | Method and Description |
|---|---|
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.
|
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<? extends WSResponse> |
patch(java.io.File body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(java.io.InputStream body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(com.fasterxml.jackson.databind.JsonNode body)
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,?>>,?> body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
patch(java.lang.String body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(java.io.File body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(java.io.InputStream body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(com.fasterxml.jackson.databind.JsonNode body)
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,?>>,?> body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
post(java.lang.String body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(java.io.File body)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(java.io.InputStream body)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(com.fasterxml.jackson.databind.JsonNode body)
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,?>>,?> body)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<WSResponse> |
put(java.lang.String body)
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,
WSAuthScheme scheme)
Sets the authentication header for the current request.
|
WSRequest |
setBody(java.io.File body)
Set the body this request should use.
|
WSRequest |
setBody(java.io.InputStream body)
Deprecated.
use
setBody(Source) instead. |
WSRequest |
setBody(com.fasterxml.jackson.databind.JsonNode body)
Set the body this request should use.
|
<U> WSRequest |
setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> body)
Set the body this request should use.
|
WSRequest |
setBody(java.lang.String body)
Set the body this request should use.
|
WSRequest |
setContentType(java.lang.String contentType)
Set the content type.
|
WSRequest |
setFollowRedirects(boolean followRedirects)
Sets whether redirects (301, 302) should be followed automatically.
|
WSRequest |
setHeader(java.lang.String name,
java.lang.String value)
Adds a header to 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 |
setMultipartBody(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
Set the multipart body this request should use.
|
WSRequest |
setQueryParameter(java.lang.String name,
java.lang.String value)
Sets a query parameter with the given name, this can be called repeatedly.
|
WSRequest |
setQueryString(java.lang.String query)
Sets the query string to query.
|
WSRequest |
setRequestFilter(WSRequestFilter filter)
Adds a request filter.
|
WSRequest |
setRequestTimeout(long timeout)
Sets the request timeout in milliseconds.
|
WSRequest |
setVirtualHost(java.lang.String virtualHost)
Sets the virtual host as a "hostname:port" string.
|
WSRequest |
sign(WSSignatureCalculator calculator)
Sets an (OAuth) signature calculator.
|
java.util.concurrent.CompletionStage<? extends StreamedResponse> |
stream()
Execute this request and stream the response body.
|
getCalculator, getContentType, getFollowRedirects, getHeaders, getPassword, getQueryParameters, getRequestTimeout, getScheme, getUrl, getUsernamejava.util.concurrent.CompletionStage<WSResponse> patch(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
body - represented as a MultipartFormData.Partjava.util.concurrent.CompletionStage<WSResponse> post(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
body - represented as a MultipartFormData.Partjava.util.concurrent.CompletionStage<WSResponse> put(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
body - represented as a MultipartFormData.PartWSRequest setMultipartBody(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
body - the body of the request.java.util.concurrent.CompletionStage<WSResponse> get()
get in interface StandaloneWSRequestjava.util.concurrent.CompletionStage<WSResponse> patch(java.lang.String body)
patch in interface StandaloneWSRequestbody - represented as Stringjava.util.concurrent.CompletionStage<WSResponse> patch(com.fasterxml.jackson.databind.JsonNode body)
patch in interface StandaloneWSRequestbody - represented as JSONjava.util.concurrent.CompletionStage<WSResponse> patch(java.io.InputStream body)
patch in interface StandaloneWSRequestbody - represented as an InputStreamjava.util.concurrent.CompletionStage<? extends WSResponse> patch(java.io.File body)
patch in interface StandaloneWSRequestbody - represented as a Filejava.util.concurrent.CompletionStage<WSResponse> post(java.lang.String body)
post in interface StandaloneWSRequestbody - represented as Stringjava.util.concurrent.CompletionStage<WSResponse> post(com.fasterxml.jackson.databind.JsonNode body)
post in interface StandaloneWSRequestbody - represented as JSONjava.util.concurrent.CompletionStage<WSResponse> post(java.io.InputStream body)
post in interface StandaloneWSRequestbody - represented as an InputStreamjava.util.concurrent.CompletionStage<WSResponse> post(java.io.File body)
post in interface StandaloneWSRequestbody - represented as a Filejava.util.concurrent.CompletionStage<WSResponse> put(java.lang.String body)
put in interface StandaloneWSRequestbody - represented as Stringjava.util.concurrent.CompletionStage<WSResponse> put(com.fasterxml.jackson.databind.JsonNode body)
put in interface StandaloneWSRequestbody - represented as JSONjava.util.concurrent.CompletionStage<WSResponse> put(java.io.InputStream body)
put in interface StandaloneWSRequestbody - represented as an InputStreamjava.util.concurrent.CompletionStage<WSResponse> put(java.io.File body)
put in interface StandaloneWSRequestbody - represented as a Filejava.util.concurrent.CompletionStage<WSResponse> delete()
delete in interface StandaloneWSRequestjava.util.concurrent.CompletionStage<WSResponse> head()
head in interface StandaloneWSRequestjava.util.concurrent.CompletionStage<WSResponse> options()
options in interface StandaloneWSRequestjava.util.concurrent.CompletionStage<WSResponse> execute(java.lang.String method)
execute in interface StandaloneWSRequestmethod - The method to executejava.util.concurrent.CompletionStage<WSResponse> execute()
execute in interface StandaloneWSRequestjava.util.concurrent.CompletionStage<? extends StreamedResponse> stream()
stream in interface StandaloneWSRequestWSRequest setMethod(java.lang.String method)
setMethod in interface StandaloneWSRequestmethod - the HTTP method.WSRequest setBody(java.lang.String body)
setBody in interface StandaloneWSRequestbody - the body of the request.WSRequest setBody(com.fasterxml.jackson.databind.JsonNode body)
setBody in interface StandaloneWSRequestbody - the body of the request.@Deprecated WSRequest setBody(java.io.InputStream body)
setBody(Source) instead.setBody in interface StandaloneWSRequestbody - DeprecatedWSRequest setBody(java.io.File body)
setBody in interface StandaloneWSRequestbody - the body of the request.<U> WSRequest setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> body)
setBody in interface StandaloneWSRequestbody - the body of the request.WSRequest setHeader(java.lang.String name, java.lang.String value)
setHeader in interface StandaloneWSRequestname - the header namevalue - the header valueWSRequest setQueryString(java.lang.String query)
setQueryString in interface StandaloneWSRequestquery - the fully formed query stringWSRequest setQueryParameter(java.lang.String name, java.lang.String value)
setQueryParameter in interface StandaloneWSRequestname - the query parameter namevalue - the query parameter valueWSRequest setAuth(java.lang.String userInfo)
setAuth in interface StandaloneWSRequestuserInfo - a string formed as "username:password".WSRequest setAuth(java.lang.String username, java.lang.String password)
setAuth in interface StandaloneWSRequestusername - the basic auth usernamepassword - the basic auth passwordWSRequest setAuth(java.lang.String username, java.lang.String password, WSAuthScheme scheme)
setAuth in interface StandaloneWSRequestusername - the usernamepassword - the passwordscheme - authentication schemeWSRequest sign(WSSignatureCalculator calculator)
sign in interface StandaloneWSRequestcalculator - the signature calculatorWSRequest setFollowRedirects(boolean followRedirects)
setFollowRedirects in interface StandaloneWSRequestfollowRedirects - true if the request should follow redirectsWSRequest setVirtualHost(java.lang.String virtualHost)
setVirtualHost in interface StandaloneWSRequestvirtualHost - the virtual hostWSRequest setRequestTimeout(long timeout)
setRequestTimeout in interface StandaloneWSRequesttimeout - the request timeout in milliseconds. A value of -1 indicates an infinite request timeout.WSRequest setRequestFilter(WSRequestFilter filter)
setRequestFilter in interface StandaloneWSRequestfilter - a transforming filter.WSRequest setContentType(java.lang.String contentType)
setContentType in interface StandaloneWSRequestcontentType - The content type