public class AhcWSRequest extends java.lang.Object implements WSRequest
| 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.
|
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<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(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.
|
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.
|
public WSRequest setMultipartBody(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
WSRequestsetMultipartBody in interface WSRequestbody - the body of the request.public java.util.concurrent.CompletionStage<WSResponse> get()
WSRequestget in interface StandaloneWSRequestget in interface WSRequestpublic java.util.concurrent.CompletionStage<WSResponse> patch(java.lang.String body)
WSRequestpatch in interface StandaloneWSRequestpatch in interface WSRequestbody - represented as Stringpublic java.util.concurrent.CompletionStage<WSResponse> patch(com.fasterxml.jackson.databind.JsonNode body)
WSRequestpatch in interface StandaloneWSRequestpatch in interface WSRequestbody - represented as JSONpublic java.util.concurrent.CompletionStage<WSResponse> patch(java.io.InputStream body)
WSRequestpatch in interface StandaloneWSRequestpatch in interface WSRequestbody - represented as an InputStreampublic java.util.concurrent.CompletionStage<WSResponse> patch(java.io.File body)
WSRequestpatch in interface StandaloneWSRequestpatch in interface WSRequestbody - represented as a Filepublic java.util.concurrent.CompletionStage<WSResponse> post(java.lang.String body)
WSRequestpost in interface StandaloneWSRequestpost in interface WSRequestbody - represented as Stringpublic java.util.concurrent.CompletionStage<WSResponse> post(com.fasterxml.jackson.databind.JsonNode body)
WSRequestpost in interface StandaloneWSRequestpost in interface WSRequestbody - represented as JSONpublic java.util.concurrent.CompletionStage<WSResponse> post(java.io.InputStream body)
WSRequestpost in interface StandaloneWSRequestpost in interface WSRequestbody - represented as an InputStreampublic java.util.concurrent.CompletionStage<WSResponse> post(java.io.File body)
WSRequestpost in interface StandaloneWSRequestpost in interface WSRequestbody - represented as a Filepublic java.util.concurrent.CompletionStage<WSResponse> put(java.lang.String body)
WSRequestput in interface StandaloneWSRequestput in interface WSRequestbody - represented as Stringpublic java.util.concurrent.CompletionStage<WSResponse> put(com.fasterxml.jackson.databind.JsonNode body)
WSRequestput in interface StandaloneWSRequestput in interface WSRequestbody - represented as JSONpublic java.util.concurrent.CompletionStage<WSResponse> put(java.io.InputStream body)
WSRequestput in interface StandaloneWSRequestput in interface WSRequestbody - represented as an InputStreampublic java.util.concurrent.CompletionStage<WSResponse> put(java.io.File body)
WSRequestput in interface StandaloneWSRequestput in interface WSRequestbody - represented as a Filepublic java.util.concurrent.CompletionStage<WSResponse> delete()
WSRequestdelete in interface StandaloneWSRequestdelete in interface WSRequestpublic java.util.concurrent.CompletionStage<WSResponse> head()
WSRequesthead in interface StandaloneWSRequesthead in interface WSRequestpublic java.util.concurrent.CompletionStage<WSResponse> options()
WSRequestoptions in interface StandaloneWSRequestoptions in interface WSRequestpublic java.util.concurrent.CompletionStage<WSResponse> execute(java.lang.String method)
WSRequestexecute in interface StandaloneWSRequestexecute in interface WSRequestmethod - The method to executepublic java.util.concurrent.CompletionStage<WSResponse> execute()
WSRequestexecute in interface StandaloneWSRequestexecute in interface WSRequestpublic java.util.concurrent.CompletionStage<? extends StreamedResponse> stream()
WSRequeststream in interface StandaloneWSRequeststream in interface WSRequestpublic WSRequest setMethod(java.lang.String method)
WSRequestsetMethod in interface StandaloneWSRequestsetMethod in interface WSRequestmethod - the HTTP method.public WSRequest setBody(java.lang.String body)
WSRequestsetBody in interface StandaloneWSRequestsetBody in interface WSRequestbody - the body of the request.public WSRequest setBody(com.fasterxml.jackson.databind.JsonNode body)
WSRequestsetBody in interface StandaloneWSRequestsetBody in interface WSRequestbody - the body of the request.@Deprecated public WSRequest setBody(java.io.InputStream body)
WSRequestsetBody in interface StandaloneWSRequestsetBody in interface WSRequestbody - Deprecatedpublic WSRequest setBody(java.io.File body)
WSRequestsetBody in interface StandaloneWSRequestsetBody in interface WSRequestbody - the body of the request.public <U> WSRequest setBody(akka.stream.javadsl.Source<akka.util.ByteString,U> body)
WSRequestsetBody in interface StandaloneWSRequestsetBody in interface WSRequestbody - the body of the request.public WSRequest setHeader(java.lang.String name, java.lang.String value)
WSRequestsetHeader in interface StandaloneWSRequestsetHeader in interface WSRequestname - the header namevalue - the header valuepublic WSRequest setQueryString(java.lang.String query)
WSRequestsetQueryString in interface StandaloneWSRequestsetQueryString in interface WSRequestquery - the fully formed query stringpublic WSRequest setQueryParameter(java.lang.String name, java.lang.String value)
WSRequestsetQueryParameter in interface StandaloneWSRequestsetQueryParameter in interface WSRequestname - the query parameter namevalue - the query parameter valuepublic WSRequest setAuth(java.lang.String userInfo)
WSRequestsetAuth in interface StandaloneWSRequestsetAuth in interface WSRequestuserInfo - a string formed as "username:password".public WSRequest setAuth(java.lang.String username, java.lang.String password)
WSRequestsetAuth in interface StandaloneWSRequestsetAuth in interface WSRequestusername - the basic auth usernamepassword - the basic auth passwordpublic WSRequest setAuth(java.lang.String username, java.lang.String password, WSAuthScheme scheme)
WSRequestsetAuth in interface StandaloneWSRequestsetAuth in interface WSRequestusername - the usernamepassword - the passwordscheme - authentication schemepublic WSRequest sign(WSSignatureCalculator calculator)
WSRequestsign in interface StandaloneWSRequestsign in interface WSRequestcalculator - the signature calculatorpublic WSRequest setFollowRedirects(boolean followRedirects)
WSRequestsetFollowRedirects in interface StandaloneWSRequestsetFollowRedirects in interface WSRequestfollowRedirects - true if the request should follow redirectspublic WSRequest setVirtualHost(java.lang.String virtualHost)
WSRequestsetVirtualHost in interface StandaloneWSRequestsetVirtualHost in interface WSRequestvirtualHost - the virtual hostpublic WSRequest setRequestTimeout(long timeout)
WSRequestsetRequestTimeout in interface StandaloneWSRequestsetRequestTimeout in interface WSRequesttimeout - the request timeout in milliseconds. A value of -1 indicates an infinite request timeout.public WSRequest setRequestFilter(WSRequestFilter filter)
WSRequestsetRequestFilter in interface StandaloneWSRequestsetRequestFilter in interface WSRequestfilter - a transforming filter.public WSRequest setContentType(java.lang.String contentType)
WSRequestsetContentType in interface StandaloneWSRequestsetContentType in interface WSRequestcontentType - The content typepublic java.lang.String getUrl()
getUrl in interface StandaloneWSRequestpublic java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getHeaders()
getHeaders in interface StandaloneWSRequestpublic java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getQueryParameters()
getQueryParameters in interface StandaloneWSRequestpublic java.lang.String getUsername()
getUsername in interface StandaloneWSRequestpublic java.lang.String getPassword()
getPassword in interface StandaloneWSRequestpublic WSAuthScheme getScheme()
getScheme in interface StandaloneWSRequestpublic WSSignatureCalculator getCalculator()
getCalculator in interface StandaloneWSRequestpublic long getRequestTimeout()
StandaloneWSRequestgetRequestTimeout in interface StandaloneWSRequestpublic boolean getFollowRedirects()
getFollowRedirects in interface StandaloneWSRequestpublic java.lang.String getContentType()
getContentType in interface StandaloneWSRequestpublic java.util.concurrent.CompletionStage<WSResponse> patch(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
WSRequestpublic java.util.concurrent.CompletionStage<WSResponse> post(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
WSRequestpublic java.util.concurrent.CompletionStage<WSResponse> put(akka.stream.javadsl.Source<? super Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>,?> body)
WSRequest