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, getUsername
java.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 StandaloneWSRequest
java.util.concurrent.CompletionStage<WSResponse> patch(java.lang.String body)
patch
in interface StandaloneWSRequest
body
- represented as Stringjava.util.concurrent.CompletionStage<WSResponse> patch(com.fasterxml.jackson.databind.JsonNode body)
patch
in interface StandaloneWSRequest
body
- represented as JSONjava.util.concurrent.CompletionStage<WSResponse> patch(java.io.InputStream body)
patch
in interface StandaloneWSRequest
body
- represented as an InputStreamjava.util.concurrent.CompletionStage<? extends WSResponse> patch(java.io.File body)
patch
in interface StandaloneWSRequest
body
- represented as a Filejava.util.concurrent.CompletionStage<WSResponse> post(java.lang.String body)
post
in interface StandaloneWSRequest
body
- represented as Stringjava.util.concurrent.CompletionStage<WSResponse> post(com.fasterxml.jackson.databind.JsonNode body)
post
in interface StandaloneWSRequest
body
- represented as JSONjava.util.concurrent.CompletionStage<WSResponse> post(java.io.InputStream body)
post
in interface StandaloneWSRequest
body
- represented as an InputStreamjava.util.concurrent.CompletionStage<WSResponse> post(java.io.File body)
post
in interface StandaloneWSRequest
body
- represented as a Filejava.util.concurrent.CompletionStage<WSResponse> put(java.lang.String body)
put
in interface StandaloneWSRequest
body
- represented as Stringjava.util.concurrent.CompletionStage<WSResponse> put(com.fasterxml.jackson.databind.JsonNode body)
put
in interface StandaloneWSRequest
body
- represented as JSONjava.util.concurrent.CompletionStage<WSResponse> put(java.io.InputStream body)
put
in interface StandaloneWSRequest
body
- represented as an InputStreamjava.util.concurrent.CompletionStage<WSResponse> put(java.io.File body)
put
in interface StandaloneWSRequest
body
- represented as a Filejava.util.concurrent.CompletionStage<WSResponse> delete()
delete
in interface StandaloneWSRequest
java.util.concurrent.CompletionStage<WSResponse> head()
head
in interface StandaloneWSRequest
java.util.concurrent.CompletionStage<WSResponse> options()
options
in interface StandaloneWSRequest
java.util.concurrent.CompletionStage<WSResponse> execute(java.lang.String method)
execute
in interface StandaloneWSRequest
method
- The method to executejava.util.concurrent.CompletionStage<WSResponse> execute()
execute
in interface StandaloneWSRequest
java.util.concurrent.CompletionStage<? extends StreamedResponse> stream()
stream
in interface StandaloneWSRequest
WSRequest setMethod(java.lang.String method)
setMethod
in interface StandaloneWSRequest
method
- the HTTP method.WSRequest setBody(java.lang.String body)
setBody
in interface StandaloneWSRequest
body
- the body of the request.WSRequest setBody(com.fasterxml.jackson.databind.JsonNode body)
setBody
in interface StandaloneWSRequest
body
- the body of the request.@Deprecated WSRequest setBody(java.io.InputStream body)
setBody(Source)
instead.setBody
in interface StandaloneWSRequest
body
- DeprecatedWSRequest setBody(java.io.File body)
setBody
in interface StandaloneWSRequest
body
- the body of the request.<U> WSRequest setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> body)
setBody
in interface StandaloneWSRequest
body
- the body of the request.WSRequest setHeader(java.lang.String name, java.lang.String value)
setHeader
in interface StandaloneWSRequest
name
- the header namevalue
- the header valueWSRequest setQueryString(java.lang.String query)
setQueryString
in interface StandaloneWSRequest
query
- the fully formed query stringWSRequest setQueryParameter(java.lang.String name, java.lang.String value)
setQueryParameter
in interface StandaloneWSRequest
name
- the query parameter namevalue
- the query parameter valueWSRequest setAuth(java.lang.String userInfo)
setAuth
in interface StandaloneWSRequest
userInfo
- a string formed as "username:password".WSRequest setAuth(java.lang.String username, java.lang.String password)
setAuth
in interface StandaloneWSRequest
username
- the basic auth usernamepassword
- the basic auth passwordWSRequest setAuth(java.lang.String username, java.lang.String password, WSAuthScheme scheme)
setAuth
in interface StandaloneWSRequest
username
- the usernamepassword
- the passwordscheme
- authentication schemeWSRequest sign(WSSignatureCalculator calculator)
sign
in interface StandaloneWSRequest
calculator
- the signature calculatorWSRequest setFollowRedirects(boolean followRedirects)
setFollowRedirects
in interface StandaloneWSRequest
followRedirects
- true if the request should follow redirectsWSRequest setVirtualHost(java.lang.String virtualHost)
setVirtualHost
in interface StandaloneWSRequest
virtualHost
- the virtual hostWSRequest setRequestTimeout(long timeout)
setRequestTimeout
in interface StandaloneWSRequest
timeout
- the request timeout in milliseconds. A value of -1 indicates an infinite request timeout.WSRequest setRequestFilter(WSRequestFilter filter)
setRequestFilter
in interface StandaloneWSRequest
filter
- a transforming filter.WSRequest setContentType(java.lang.String contentType)
setContentType
in interface StandaloneWSRequest
contentType
- The content type