Package play.libs.ws.ahc
Class AhcWSResponse
java.lang.Object
play.libs.ws.ahc.AhcWSResponse
- All Implemented Interfaces:
play.libs.ws.StandaloneWSResponse,WSResponse
A Play WS response backed by an AsyncHttpClient response.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]Deprecated.com.fasterxml.jackson.databind.JsonNodeasJson()Deprecated.Useresponse.getBody(json())asXml()Deprecated.Useresponse.getBody(xml())Deprecated.Deprecated since 2.6.0.getBody()<T> TgetBody(play.libs.ws.BodyReadable<T> readable) Gets the body of the response as a T, using aBodyReadable.Source<ByteString,?> Deprecated.Useresponse.getBody(inputStream())Optional<play.libs.ws.WSCookie>List<play.libs.ws.WSCookie>getHeaderValues(String name) getSingleHeader(String name) intGets the underlying implementation response object, if any.getUri()
-
Method Details
-
getHeaders
- Specified by:
getHeadersin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getHeadersin interfaceWSResponse
-
getHeaderValues
- Specified by:
getHeaderValuesin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getHeaderValuesin interfaceWSResponse
-
getSingleHeader
- Specified by:
getSingleHeaderin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getSingleHeaderin interfaceWSResponse
-
getUnderlying
Description copied from interface:WSResponseGets the underlying implementation response object, if any.- Specified by:
getUnderlyingin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getUnderlyingin interfaceWSResponse
-
getContentType
- Specified by:
getContentTypein interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getContentTypein interfaceWSResponse
-
getStatus
public int getStatus()- Specified by:
getStatusin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getStatusin interfaceWSResponse- Returns:
- the HTTP status code from the response.
-
getStatusText
- Specified by:
getStatusTextin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getStatusTextin interfaceWSResponse- Returns:
- the text associated with the status code.
-
getCookies
- Specified by:
getCookiesin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getCookiesin interfaceWSResponse- Returns:
- all the cookies from the response.
-
getCookie
- Specified by:
getCookiein interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getCookiein interfaceWSResponse- Returns:
- a single cookie from the response, if any.
-
getBodyAsBytes
- Specified by:
getBodyAsBytesin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getBodyAsBytesin interfaceWSResponse- Returns:
- the body as a ByteString
-
getBody
public <T> T getBody(play.libs.ws.BodyReadable<T> readable) Description copied from interface:WSResponseGets the body of the response as a T, using aBodyReadable.See
WSBodyReadablesfor convenient functions.- Specified by:
getBodyin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getBodyin interfaceWSResponse- Type Parameters:
T- the type to return, i.e. String.- Parameters:
readable- a transformation function from a response to a T.- Returns:
- the body as an instance of T.
-
getBodyAsSource
- Specified by:
getBodyAsSourcein interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getBodyAsSourcein interfaceWSResponse- Returns:
- the body as a Source
-
getBody
- Specified by:
getBodyin interfaceplay.libs.ws.StandaloneWSResponse- Specified by:
getBodyin interfaceWSResponse- Returns:
- the body as a string.
-
getUri
- Specified by:
getUriin interfaceplay.libs.ws.StandaloneWSResponse
-
getAllHeaders
Deprecated.Deprecated since 2.6.0. UsegetHeaders()instead.Description copied from interface:WSResponseGets all the headers from the response.- Specified by:
getAllHeadersin interfaceWSResponse- Returns:
- the headers
-
asXml
Deprecated.Useresponse.getBody(xml())Description copied from interface:WSResponsereturn the body as XML.- Specified by:
asXmlin interfaceWSResponse
-
asJson
Deprecated.Useresponse.getBody(json())Description copied from interface:WSResponseGets the body as JSON node.- Specified by:
asJsonin interfaceWSResponse- Returns:
- json node.
-
getBodyAsStream
Deprecated.Useresponse.getBody(inputStream())Description copied from interface:WSResponseGets the body as a stream.- Specified by:
getBodyAsStreamin interfaceWSResponse
-
asByteArray
Deprecated.Useresponse.getBodyAsBytes().toArray()Description copied from interface:WSResponseGets the body as an array of bytes.- Specified by:
asByteArrayin interfaceWSResponse
-
response.getBodyAsBytes().toArray()