public class StandaloneAhcWSRequest extends java.lang.Object implements StandaloneWSRequest
Constructor and Description |
---|
StandaloneAhcWSRequest(StandaloneAhcWSClient client,
java.lang.String url,
akka.stream.Materializer materializer) |
StandaloneAhcWSRequest(StandaloneAhcWSClient client,
java.lang.String url,
akka.stream.Materializer materializer,
com.fasterxml.jackson.databind.ObjectMapper mapper) |
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.
|
StandaloneAhcWSRequest |
setAuth(java.lang.String userInfo)
Sets the authentication header for the current request using BASIC authentication.
|
StandaloneAhcWSRequest |
setAuth(java.lang.String username,
java.lang.String password)
Sets the authentication header for the current request using BASIC authentication.
|
StandaloneAhcWSRequest |
setAuth(java.lang.String username,
java.lang.String password,
WSAuthScheme scheme)
Sets the authentication header for the current request.
|
StandaloneAhcWSRequest |
setBody(java.io.File body)
Set the body this request should use.
|
StandaloneAhcWSRequest |
setBody(java.io.InputStream body)
Deprecated.
use
setBody(Source) instead. |
StandaloneAhcWSRequest |
setBody(com.fasterxml.jackson.databind.JsonNode body)
Set the body this request should use.
|
StandaloneAhcWSRequest |
setBody(java.lang.Object body)
Sets a body directly.
|
<U> StandaloneAhcWSRequest |
setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> body)
Set the body this request should use.
|
StandaloneAhcWSRequest |
setBody(java.lang.String body)
Set the body this request should use.
|
StandaloneAhcWSRequest |
setContentType(java.lang.String contentType)
Set the content type.
|
StandaloneAhcWSRequest |
setFollowRedirects(boolean followRedirects)
Sets whether redirects (301, 302) should be followed automatically.
|
StandaloneAhcWSRequest |
setHeader(java.lang.String name,
java.lang.String value)
Sets a header with the given name, this can be called repeatedly.
|
StandaloneAhcWSRequest |
setMethod(java.lang.String method)
Sets the HTTP method this request should use, where the no args execute() method is invoked.
|
StandaloneAhcWSRequest |
setQueryParameter(java.lang.String name,
java.lang.String value)
Sets a query parameter with the given name, this can be called repeatedly.
|
StandaloneAhcWSRequest |
setQueryString(java.lang.String query)
Sets a query string
|
StandaloneAhcWSRequest |
setRequestFilter(WSRequestFilter filter)
Adds a request filter.
|
StandaloneAhcWSRequest |
setRequestTimeout(long timeout)
Sets the request timeout in milliseconds.
|
StandaloneAhcWSRequest |
setVirtualHost(java.lang.String virtualHost)
Sets the virtual host as a "hostname:port" string.
|
StandaloneAhcWSRequest |
sign(WSSignatureCalculator calculator)
Sets an (OAuth) signature calculator.
|
java.util.concurrent.CompletionStage<? extends StreamedResponse> |
stream()
Execute this request and stream the response body.
|
public StandaloneAhcWSRequest(StandaloneAhcWSClient client, java.lang.String url, akka.stream.Materializer materializer, com.fasterxml.jackson.databind.ObjectMapper mapper)
public StandaloneAhcWSRequest(StandaloneAhcWSClient client, java.lang.String url, akka.stream.Materializer materializer)
public StandaloneAhcWSRequest setRequestFilter(WSRequestFilter filter)
StandaloneWSRequest
setRequestFilter
in interface StandaloneWSRequest
filter
- a transforming filter.public StandaloneAhcWSRequest setHeader(java.lang.String name, java.lang.String value)
setHeader
in interface StandaloneWSRequest
name
- the header namevalue
- the header valuepublic StandaloneAhcWSRequest setQueryString(java.lang.String query)
setQueryString
in interface StandaloneWSRequest
query
- the query stringpublic StandaloneAhcWSRequest setQueryParameter(java.lang.String name, java.lang.String value)
StandaloneWSRequest
setQueryParameter
in interface StandaloneWSRequest
name
- the query parameter namevalue
- the query parameter valuepublic StandaloneAhcWSRequest setAuth(java.lang.String userInfo)
StandaloneWSRequest
setAuth
in interface StandaloneWSRequest
userInfo
- a string formed as "username:password".public StandaloneAhcWSRequest setAuth(java.lang.String username, java.lang.String password)
StandaloneWSRequest
setAuth
in interface StandaloneWSRequest
username
- the basic auth usernamepassword
- the basic auth passwordpublic StandaloneAhcWSRequest setAuth(java.lang.String username, java.lang.String password, WSAuthScheme scheme)
StandaloneWSRequest
setAuth
in interface StandaloneWSRequest
username
- the usernamepassword
- the passwordscheme
- authentication schemepublic StandaloneAhcWSRequest sign(WSSignatureCalculator calculator)
StandaloneWSRequest
sign
in interface StandaloneWSRequest
calculator
- the signature calculatorpublic StandaloneAhcWSRequest setFollowRedirects(boolean followRedirects)
StandaloneWSRequest
setFollowRedirects
in interface StandaloneWSRequest
followRedirects
- true if the request should follow redirectspublic StandaloneAhcWSRequest setVirtualHost(java.lang.String virtualHost)
StandaloneWSRequest
setVirtualHost
in interface StandaloneWSRequest
virtualHost
- the virtual hostpublic StandaloneAhcWSRequest setRequestTimeout(long timeout)
StandaloneWSRequest
setRequestTimeout
in interface StandaloneWSRequest
timeout
- the request timeout in milliseconds. A value of -1 indicates an infinite request timeout.public StandaloneAhcWSRequest setContentType(java.lang.String contentType)
StandaloneWSRequest
setContentType
in interface StandaloneWSRequest
contentType
- The content typepublic java.lang.String getContentType()
getContentType
in interface StandaloneWSRequest
public StandaloneAhcWSRequest setMethod(java.lang.String method)
StandaloneWSRequest
setMethod
in interface StandaloneWSRequest
method
- the HTTP method.public StandaloneAhcWSRequest setBody(java.lang.Object body)
body
- the body as an unbound object.public StandaloneAhcWSRequest setBody(java.lang.String body)
StandaloneWSRequest
setBody
in interface StandaloneWSRequest
body
- the body of the request.public StandaloneAhcWSRequest setBody(com.fasterxml.jackson.databind.JsonNode body)
StandaloneWSRequest
setBody
in interface StandaloneWSRequest
body
- the body of the request.@Deprecated public StandaloneAhcWSRequest setBody(java.io.InputStream body)
setBody(Source)
instead.setBody
in interface StandaloneWSRequest
body
- Deprecatedpublic StandaloneAhcWSRequest setBody(java.io.File body)
StandaloneWSRequest
setBody
in interface StandaloneWSRequest
body
- the body of the request.public <U> StandaloneAhcWSRequest setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> body)
StandaloneWSRequest
setBody
in interface StandaloneWSRequest
body
- the body of the request.public java.lang.String getUrl()
getUrl
in interface StandaloneWSRequest
public java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getHeaders()
getHeaders
in interface StandaloneWSRequest
public java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getQueryParameters()
getQueryParameters
in interface StandaloneWSRequest
public java.lang.String getUsername()
getUsername
in interface StandaloneWSRequest
public java.lang.String getPassword()
getPassword
in interface StandaloneWSRequest
public WSAuthScheme getScheme()
getScheme
in interface StandaloneWSRequest
public WSSignatureCalculator getCalculator()
getCalculator
in interface StandaloneWSRequest
public long getRequestTimeout()
StandaloneWSRequest
getRequestTimeout
in interface StandaloneWSRequest
public boolean getFollowRedirects()
getFollowRedirects
in interface StandaloneWSRequest
public java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> get()
StandaloneWSRequest
get
in interface StandaloneWSRequest
public java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> patch(java.lang.String body)
StandaloneWSRequest
patch
in interface StandaloneWSRequest
body
- represented as Stringpublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> patch(com.fasterxml.jackson.databind.JsonNode body)
StandaloneWSRequest
patch
in interface StandaloneWSRequest
body
- represented as JSONpublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> patch(java.io.InputStream body)
StandaloneWSRequest
patch
in interface StandaloneWSRequest
body
- represented as an InputStreampublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> patch(java.io.File body)
StandaloneWSRequest
patch
in interface StandaloneWSRequest
body
- represented as a Filepublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> post(java.lang.String body)
StandaloneWSRequest
post
in interface StandaloneWSRequest
body
- represented as Stringpublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> post(com.fasterxml.jackson.databind.JsonNode body)
StandaloneWSRequest
post
in interface StandaloneWSRequest
body
- represented as JSONpublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> post(java.io.InputStream body)
StandaloneWSRequest
post
in interface StandaloneWSRequest
body
- represented as an InputStreampublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> post(java.io.File body)
StandaloneWSRequest
post
in interface StandaloneWSRequest
body
- represented as a Filepublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> put(java.lang.String body)
StandaloneWSRequest
put
in interface StandaloneWSRequest
body
- represented as Stringpublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> put(com.fasterxml.jackson.databind.JsonNode body)
StandaloneWSRequest
put
in interface StandaloneWSRequest
body
- represented as JSONpublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> put(java.io.InputStream body)
StandaloneWSRequest
put
in interface StandaloneWSRequest
body
- represented as an InputStreampublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> put(java.io.File body)
StandaloneWSRequest
put
in interface StandaloneWSRequest
body
- represented as a Filepublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> delete()
StandaloneWSRequest
delete
in interface StandaloneWSRequest
public java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> head()
StandaloneWSRequest
head
in interface StandaloneWSRequest
public java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> options()
StandaloneWSRequest
options
in interface StandaloneWSRequest
public java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> execute(java.lang.String method)
StandaloneWSRequest
execute
in interface StandaloneWSRequest
method
- The method to executepublic java.util.concurrent.CompletionStage<? extends StandaloneWSResponse> execute()
StandaloneWSRequest
execute
in interface StandaloneWSRequest
public java.util.concurrent.CompletionStage<? extends StreamedResponse> stream()
StandaloneWSRequest
stream
in interface StandaloneWSRequest