Package play.libs.ws.ahc
Class AhcWSRequest
java.lang.Object
play.libs.ws.ahc.AhcWSRequest
- All Implemented Interfaces:
play.libs.ws.StandaloneWSRequest,WSRequest
A Play WS request backed by AsyncHTTPClient implementation.
-
Method Summary
Modifier and TypeMethodDescriptionaddCookie(play.libs.ws.WSCookie cookie) Adds a cookie to the requestaddCookie(Http.Cookie cookie) Adds a cookie to the requestaddCookies(play.libs.ws.WSCookie... cookies) Sets several cookies on the request.Adds a header to the request.addQueryParameter(String name, String value) Sets a query parameter with the given name, this can be called repeatedly.delete()Perform a DELETE on the request asynchronously.execute()Execute an arbitrary method on the request asynchronously.Execute an arbitrary method on the request asynchronously.get()Perform a GET on the request asynchronously.Optional<play.libs.ws.WSAuthInfo>getAuth()Optional<play.libs.ws.BodyWritable>getBody()Optional<play.libs.ws.WSSignatureCalculator>getHeaderValues(String name) getUrl()head()Perform a HEAD on the request asynchronously.options()Perform an OPTIONS on the request asynchronously.patch(com.fasterxml.jackson.databind.JsonNode jsonNode) Perform a PATCH on the request asynchronously.Perform a PATCH on the request asynchronously.patch(InputStream inputStream) Deprecated.Perform a PATCH on the request asynchronously.patch(Source<? super Http.MultipartFormData.Part<Source<ByteString, ?>>, ?> bodyPartSource) Perform a PATCH on the request asynchronously.Perform a PATCH on the request asynchronously.patch(play.libs.ws.BodyWritable body) Perform a PATCH on the request asynchronously.post(com.fasterxml.jackson.databind.JsonNode json) Perform a POST on the request asynchronously.Perform a POST on the request asynchronously.post(InputStream is) Deprecated.Perform a POST on the request asynchronously.post(Source<? super Http.MultipartFormData.Part<Source<ByteString, ?>>, ?> bodyPartSource) Perform a POST on the request asynchronously.Perform a POST on the request asynchronously.post(play.libs.ws.BodyWritable body) Perform a POST on the request asynchronously.put(com.fasterxml.jackson.databind.JsonNode json) Perform a PUT on the request asynchronously.Perform a PUT on the request asynchronously.put(InputStream is) Deprecated.Perform a PUT on the request asynchronously.put(Source<? super Http.MultipartFormData.Part<Source<ByteString, ?>>, ?> bodyPartSource) Perform a PUT on the request asynchronously.Perform a PUT on the request asynchronously.put(play.libs.ws.BodyWritable body) Perform a PUT on the request asynchronously.Sets the authentication header for the current request using BASIC authentication.Sets the authentication header for the current request using BASIC authentication.Sets the authentication header for the current request.play.libs.ws.StandaloneWSRequestsetAuth(play.libs.ws.WSAuthInfo authInfo) setBody(com.fasterxml.jackson.databind.JsonNode json) Set the body this request should use.Set the body this request should use.setBody(InputStream is) Deprecated.Set the body this request should use.<U> WSRequestsetBody(Source<ByteString, U> source) Set the body this request should use.setBody(play.libs.ws.BodyWritable bodyWritable) Set the body this request should use.setContentType(String contentType) Set the content type.setCookies(List<play.libs.ws.WSCookie> cookies) Sets all the cookies on the request.setDisableUrlEncoding(boolean disableUrlEncoding) setFollowRedirects(boolean followRedirects) Sets whether redirects (301, 302) should be followed automatically.Deprecated.use addHeader(name, value)setHeaders(Map<String, List<String>> headers) Sets all of the headers on the request.Sets the HTTP method this request should use, where the no args execute() method is invoked.setQueryParameter(String name, String value) Deprecated.Use addQueryParametersetQueryString(String query) Sets the query string to query.setQueryString(Map<String, List<String>> params) Sets the query string to query.setRequestFilter(play.libs.ws.WSRequestFilter filter) Adds a request filter.setRequestTimeout(long timeout) Deprecated.setRequestTimeout(Duration timeout) Sets the request timeout in milliseconds.play.libs.ws.StandaloneWSRequestsetVirtualHost(String virtualHost) Sets the virtual host as a "hostname:port" string.sign(play.libs.ws.WSSignatureCalculator calculator) Sets an (OAuth) signature calculator.stream()Execute this request and stream the response body.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface play.libs.ws.StandaloneWSRequest
getCookies, getMethod, getPassword, getScheme, getUsername
-
Method Details
-
get
Description copied from interface:WSRequestPerform a GET on the request asynchronously. -
patch
Description copied from interface:WSRequestPerform a PATCH on the request asynchronously. -
patch
Description copied from interface:WSRequestPerform a PATCH on the request asynchronously. -
patch
Description copied from interface:WSRequestPerform a PATCH on the request asynchronously. -
patch
Description copied from interface:WSRequestPerform a PATCH on the request asynchronously. -
patch
Deprecated.Description copied from interface:WSRequestPerform a PATCH on the request asynchronously. -
patch
Description copied from interface:WSRequestPerform a PATCH on the request asynchronously. -
patch
public CompletionStage<WSResponse> patch(Source<? super Http.MultipartFormData.Part<Source<ByteString, ?>>, ?> bodyPartSource) Description copied from interface:WSRequestPerform a PATCH on the request asynchronously. -
post
Description copied from interface:WSRequestPerform a POST on the request asynchronously. -
post
Description copied from interface:WSRequestPerform a POST on the request asynchronously. -
post
Description copied from interface:WSRequestPerform a POST on the request asynchronously. -
post
Description copied from interface:WSRequestPerform a POST on the request asynchronously. -
post
Deprecated.Description copied from interface:WSRequestPerform a POST on the request asynchronously. -
post
Description copied from interface:WSRequestPerform a POST on the request asynchronously. -
post
public CompletionStage<WSResponse> post(Source<? super Http.MultipartFormData.Part<Source<ByteString, ?>>, ?> bodyPartSource) Description copied from interface:WSRequestPerform a POST on the request asynchronously. -
put
Description copied from interface:WSRequestPerform a PUT on the request asynchronously. -
put
Description copied from interface:WSRequestPerform a PUT on the request asynchronously. -
put
Description copied from interface:WSRequestPerform a PUT on the request asynchronously. -
put
Description copied from interface:WSRequestPerform a PUT on the request asynchronously. -
put
Deprecated.Description copied from interface:WSRequestPerform a PUT on the request asynchronously. -
put
Description copied from interface:WSRequestPerform a PUT on the request asynchronously. -
put
public CompletionStage<WSResponse> put(Source<? super Http.MultipartFormData.Part<Source<ByteString, ?>>, ?> bodyPartSource) Description copied from interface:WSRequestPerform a PUT on the request asynchronously. -
delete
Description copied from interface:WSRequestPerform a DELETE on the request asynchronously. -
head
Description copied from interface:WSRequestPerform a HEAD on the request asynchronously. -
options
Description copied from interface:WSRequestPerform an OPTIONS on the request asynchronously. -
execute
Description copied from interface:WSRequestExecute an arbitrary method on the request asynchronously. -
execute
Description copied from interface:WSRequestExecute an arbitrary method on the request asynchronously. Should be used with setMethod(). -
stream
Description copied from interface:WSRequestExecute this request and stream the response body. -
setMethod
Description copied from interface:WSRequestSets the HTTP method this request should use, where the no args execute() method is invoked. -
setBody
Description copied from interface:WSRequestSet the body this request should use. -
setBody
Description copied from interface:WSRequestSet the body this request should use. -
setBody
Description copied from interface:WSRequestSet the body this request should use. -
setBody
Deprecated.Description copied from interface:WSRequestSet the body this request should use. -
setBody
Description copied from interface:WSRequestSet the body this request should use. -
setBody
Description copied from interface:WSRequestSet the body this request should use. -
setHeader
Deprecated.use addHeader(name, value)Description copied from interface:WSRequestAdds a header to the request. Note that duplicate headers are allowed by the HTTP specification, and removing a header is not available through this API. -
setHeaders
Description copied from interface:WSRequestSets all of the headers on the request.- Specified by:
setHeadersin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setHeadersin interfaceWSRequest- Parameters:
headers- the headers- Returns:
- the modified WSRequest.
-
addHeader
Description copied from interface:WSRequestAdds a header to the request. Note that duplicate headers are allowed by the HTTP specification, and removing a header is not available through this API. -
setQueryString
Description copied from interface:WSRequestSets the query string to query.- Specified by:
setQueryStringin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setQueryStringin interfaceWSRequest- Parameters:
query- the fully formed query string- Returns:
- the modified WSRequest.
-
setQueryParameter
Deprecated.Use addQueryParameterDescription copied from interface:WSRequestSets a query parameter with the given name, this can be called repeatedly. Duplicate query parameters are allowed.- Specified by:
setQueryParameterin interfaceWSRequest- Parameters:
name- the query parameter namevalue- the query parameter value- Returns:
- the modified WSRequest.
-
addQueryParameter
Description copied from interface:WSRequestSets a query parameter with the given name, this can be called repeatedly. Duplicate query parameters are allowed.- Specified by:
addQueryParameterin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
addQueryParameterin interfaceWSRequest- Parameters:
name- the query parameter namevalue- the query parameter value- Returns:
- the modified WSRequest.
-
setQueryString
Description copied from interface:WSRequestSets the query string to query.- Specified by:
setQueryStringin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setQueryStringin interfaceWSRequest- Parameters:
params- the query string parameters- Returns:
- the modified WSRequest.
-
setUrl
- Specified by:
setUrlin interfaceplay.libs.ws.StandaloneWSRequest
-
addCookie
Description copied from interface:WSRequestAdds a cookie to the request -
addCookie
Description copied from interface:WSRequestAdds a cookie to the request -
addCookies
Description copied from interface:WSRequestSets several cookies on the request.- Specified by:
addCookiesin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
addCookiesin interfaceWSRequest- Parameters:
cookies- the cookies.- Returns:
- the modified request
-
setCookies
Description copied from interface:WSRequestSets all the cookies on the request.- Specified by:
setCookiesin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setCookiesin interfaceWSRequest- Parameters:
cookies- all the cookies.- Returns:
- the modified request
-
setAuth
Description copied from interface:WSRequestSets the authentication header for the current request using BASIC authentication. -
setAuth
Description copied from interface:WSRequestSets the authentication header for the current request using BASIC authentication. -
setAuth
Description copied from interface:WSRequestSets the authentication header for the current request. -
setAuth
public play.libs.ws.StandaloneWSRequest setAuth(play.libs.ws.WSAuthInfo authInfo) - Specified by:
setAuthin interfaceplay.libs.ws.StandaloneWSRequest
-
sign
Description copied from interface:WSRequestSets an (OAuth) signature calculator. -
setFollowRedirects
Description copied from interface:WSRequestSets whether redirects (301, 302) should be followed automatically.- Specified by:
setFollowRedirectsin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setFollowRedirectsin interfaceWSRequest- Parameters:
followRedirects- true if the request should follow redirects- Returns:
- the modified WSRequest
-
setDisableUrlEncoding
- Specified by:
setDisableUrlEncodingin interfaceplay.libs.ws.StandaloneWSRequest
-
setVirtualHost
Description copied from interface:WSRequestSets the virtual host as a "hostname:port" string.- Specified by:
setVirtualHostin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setVirtualHostin interfaceWSRequest- Parameters:
virtualHost- the virtual host- Returns:
- the modified WSRequest
-
setRequestTimeout
Deprecated.Description copied from interface:WSRequestSets the request timeout in milliseconds.- Specified by:
setRequestTimeoutin interfaceWSRequest- Parameters:
timeout- the request timeout in milliseconds. A value of -1 indicates an infinite request timeout.- Returns:
- the modified WSRequest.
-
setRequestTimeout
Description copied from interface:WSRequestSets the request timeout in milliseconds.- Specified by:
setRequestTimeoutin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setRequestTimeoutin interfaceWSRequest- Parameters:
timeout- the request timeout in milliseconds. A value of -1 indicates an infinite request timeout.- Returns:
- the modified WSRequest.
-
setRequestFilter
Description copied from interface:WSRequestAdds a request filter.- Specified by:
setRequestFilterin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setRequestFilterin interfaceWSRequest- Parameters:
filter- a transforming filter.- Returns:
- the modified request.
-
setContentType
Description copied from interface:WSRequestSet the content type. If the request body is a String, and no charset parameter is included, then it will default to UTF-8.- Specified by:
setContentTypein interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
setContentTypein interfaceWSRequest- Parameters:
contentType- The content type- Returns:
- the modified WSRequest
-
getAuth
- Specified by:
getAuthin interfaceplay.libs.ws.StandaloneWSRequest
-
getBody
- Specified by:
getBodyin interfaceplay.libs.ws.StandaloneWSRequest
-
getCalculator
- Specified by:
getCalculatorin interfaceplay.libs.ws.StandaloneWSRequest
-
getContentType
- Specified by:
getContentTypein interfaceplay.libs.ws.StandaloneWSRequest
-
getFollowRedirects
- Specified by:
getFollowRedirectsin interfaceplay.libs.ws.StandaloneWSRequest
-
getDisableUrlEncoding
- Specified by:
getDisableUrlEncodingin interfaceplay.libs.ws.StandaloneWSRequest
-
getUrl
-
getHeaders
- Specified by:
getHeadersin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
getHeadersin interfaceWSRequest- Returns:
- the headers (a copy to prevent side-effects). This has not passed through an internal request builder and so will not be signed.
-
getHeaderValues
- Specified by:
getHeaderValuesin interfaceplay.libs.ws.StandaloneWSRequest
-
getHeader
- Specified by:
getHeaderin interfaceplay.libs.ws.StandaloneWSRequest
-
getRequestTimeout
- Specified by:
getRequestTimeoutin interfaceplay.libs.ws.StandaloneWSRequest
-
getQueryParameters
- Specified by:
getQueryParametersin interfaceplay.libs.ws.StandaloneWSRequest- Specified by:
getQueryParametersin interfaceWSRequest- Returns:
- the query parameters (a copy to prevent side-effects). This has not passed through an internal request builder and so will not be signed.
-