public interface StandaloneWSRequest
Note that this interface does not expose properties that are only exposed after building the request: notably, the URL, headers and query parameters are shown before an OAuth signature is calculated.
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
delete()
Perform a DELETE on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
execute()
Execute an arbitrary method on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
execute(java.lang.String method)
Execute an arbitrary method on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
get()
Perform a GET on the request asynchronously.
|
WSSignatureCalculator |
getCalculator() |
java.lang.String |
getContentType() |
boolean |
getFollowRedirects() |
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> |
getHeaders() |
java.lang.String |
getPassword() |
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> |
getQueryParameters() |
long |
getRequestTimeout()
Gets the original request timeout in milliseconds, passed into the
request as input.
|
WSAuthScheme |
getScheme() |
java.lang.String |
getUrl() |
java.lang.String |
getUsername() |
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
head()
Perform a HEAD on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
options()
Perform an OPTIONS on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
patch(java.io.File body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
patch(java.io.InputStream body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
patch(com.fasterxml.jackson.databind.JsonNode body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
patch(java.lang.String body)
Perform a PATCH on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
post(java.io.File body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
post(java.io.InputStream body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
post(com.fasterxml.jackson.databind.JsonNode body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
post(java.lang.String body)
Perform a POST on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
put(java.io.File body)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
put(java.io.InputStream body)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
put(com.fasterxml.jackson.databind.JsonNode body)
Perform a PUT on the request asynchronously.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> |
put(java.lang.String body)
Perform a PUT on the request asynchronously.
|
StandaloneWSRequest |
setAuth(java.lang.String userInfo)
Sets the authentication header for the current request using BASIC authentication.
|
StandaloneWSRequest |
setAuth(java.lang.String username,
java.lang.String password)
Sets the authentication header for the current request using BASIC authentication.
|
StandaloneWSRequest |
setAuth(java.lang.String username,
java.lang.String password,
WSAuthScheme scheme)
Sets the authentication header for the current request.
|
StandaloneWSRequest |
setBody(java.io.File body)
Set the body this request should use.
|
StandaloneWSRequest |
setBody(java.io.InputStream body)
Deprecated.
use
setBody(Source) instead. |
StandaloneWSRequest |
setBody(com.fasterxml.jackson.databind.JsonNode body)
Set the body this request should use.
|
<U> StandaloneWSRequest |
setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> body)
Set the body this request should use.
|
StandaloneWSRequest |
setBody(java.lang.String body)
Set the body this request should use.
|
StandaloneWSRequest |
setContentType(java.lang.String contentType)
Set the content type.
|
StandaloneWSRequest |
setFollowRedirects(boolean followRedirects)
Sets whether redirects (301, 302) should be followed automatically.
|
StandaloneWSRequest |
setHeader(java.lang.String name,
java.lang.String value)
Adds a header to the request.
|
StandaloneWSRequest |
setMethod(java.lang.String method)
Sets the HTTP method this request should use, where the no args execute() method is invoked.
|
StandaloneWSRequest |
setQueryParameter(java.lang.String name,
java.lang.String value)
Sets a query parameter with the given name, this can be called repeatedly.
|
StandaloneWSRequest |
setQueryString(java.lang.String query)
Sets the query string to query.
|
StandaloneWSRequest |
setRequestFilter(WSRequestFilter filter)
Adds a request filter.
|
StandaloneWSRequest |
setRequestTimeout(long timeout)
Sets the request timeout in milliseconds.
|
StandaloneWSRequest |
setVirtualHost(java.lang.String virtualHost)
Sets the virtual host as a "hostname:port" string.
|
StandaloneWSRequest |
sign(WSSignatureCalculator calculator)
Sets an (OAuth) signature calculator.
|
java.util.concurrent.CompletionStage<? extends StreamedResponse> |
stream()
Execute this request and stream the response body.
|
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> get()
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> patch(java.lang.String body)
body
- represented as Stringjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> patch(com.fasterxml.jackson.databind.JsonNode body)
body
- represented as JSONjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> patch(java.io.InputStream body)
body
- represented as an InputStreamjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> patch(java.io.File body)
body
- represented as a Filejava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> post(java.lang.String body)
body
- represented as Stringjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> post(com.fasterxml.jackson.databind.JsonNode body)
body
- represented as JSONjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> post(java.io.InputStream body)
body
- represented as an InputStreamjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> post(java.io.File body)
body
- represented as a Filejava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> put(java.lang.String body)
body
- represented as Stringjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> put(com.fasterxml.jackson.databind.JsonNode body)
body
- represented as JSONjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> put(java.io.InputStream body)
body
- represented as an InputStreamjava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> put(java.io.File body)
body
- represented as a Filejava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> delete()
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> head()
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> options()
java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> execute(java.lang.String method)
method
- The method to executejava.util.concurrent.CompletionStage<? extends StandaloneWSResponse> execute()
java.util.concurrent.CompletionStage<? extends StreamedResponse> stream()
StandaloneWSRequest setMethod(java.lang.String method)
method
- the HTTP method.StandaloneWSRequest setBody(java.lang.String body)
body
- the body of the request.StandaloneWSRequest setBody(com.fasterxml.jackson.databind.JsonNode body)
body
- the body of the request.@Deprecated StandaloneWSRequest setBody(java.io.InputStream body)
setBody(Source)
instead.body
- DeprecatedStandaloneWSRequest setBody(java.io.File body)
body
- the body of the request.<U> StandaloneWSRequest setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> body)
body
- the body of the request.StandaloneWSRequest setHeader(java.lang.String name, java.lang.String value)
name
- the header namevalue
- the header valueStandaloneWSRequest setQueryString(java.lang.String query)
query
- the fully formed query stringStandaloneWSRequest setQueryParameter(java.lang.String name, java.lang.String value)
name
- the query parameter namevalue
- the query parameter valueStandaloneWSRequest setAuth(java.lang.String userInfo)
userInfo
- a string formed as "username:password".StandaloneWSRequest setAuth(java.lang.String username, java.lang.String password)
username
- the basic auth usernamepassword
- the basic auth passwordStandaloneWSRequest setAuth(java.lang.String username, java.lang.String password, WSAuthScheme scheme)
username
- the usernamepassword
- the passwordscheme
- authentication schemeStandaloneWSRequest sign(WSSignatureCalculator calculator)
calculator
- the signature calculatorStandaloneWSRequest setFollowRedirects(boolean followRedirects)
followRedirects
- true if the request should follow redirectsStandaloneWSRequest setVirtualHost(java.lang.String virtualHost)
virtualHost
- the virtual hostStandaloneWSRequest setRequestTimeout(long timeout)
timeout
- the request timeout in milliseconds. A value of -1 indicates an infinite request timeout.StandaloneWSRequest setRequestFilter(WSRequestFilter filter)
filter
- a transforming filter.StandaloneWSRequest setContentType(java.lang.String contentType)
contentType
- The content typejava.lang.String getUrl()
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getHeaders()
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getQueryParameters()
java.lang.String getUsername()
java.lang.String getPassword()
WSAuthScheme getScheme()
WSSignatureCalculator getCalculator()
long getRequestTimeout()
boolean getFollowRedirects()
java.lang.String getContentType()