Package play.libs.ws
Class WSAsync.HttpAsyncResponse
- java.lang.Object
-
- play.libs.WS.HttpResponse
-
- play.libs.ws.WSAsync.HttpAsyncResponse
-
- Enclosing class:
- WSAsync
public static class WSAsync.HttpAsyncResponse extends WS.HttpResponse
An HTTP response wrapper
-
-
Constructor Summary
Constructors Constructor Description HttpAsyncResponse(com.ning.http.client.Response response)You shouldn't have to create an HttpResponse yourself
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHeader(java.lang.String key)java.util.List<Http.Header>getHeaders()java.lang.IntegergetStatus()The HTTP status codejava.lang.StringgetStatusText()the HTTP status textjava.io.InputStreamgetStream()get the response as a streamjava.lang.StringgetString()get the response body as a stringjava.lang.StringgetString(java.lang.String encoding)get the response body as a string-
Methods inherited from class play.libs.WS.HttpResponse
getContentType, getEncoding, getJson, getQueryString, getXml, getXml, getXml, getXml, success
-
-
-
-
Method Detail
-
getStatus
public java.lang.Integer getStatus()
The HTTP status code- Specified by:
getStatusin classWS.HttpResponse- Returns:
- the status code of the http response
-
getStatusText
public java.lang.String getStatusText()
the HTTP status text- Specified by:
getStatusTextin classWS.HttpResponse- Returns:
- the status text of the http response
-
getHeader
public java.lang.String getHeader(java.lang.String key)
- Specified by:
getHeaderin classWS.HttpResponse
-
getHeaders
public java.util.List<Http.Header> getHeaders()
- Specified by:
getHeadersin classWS.HttpResponse
-
getString
public java.lang.String getString()
Description copied from class:WS.HttpResponseget the response body as a string- Specified by:
getStringin classWS.HttpResponse- Returns:
- the body of the http response
-
getString
public java.lang.String getString(java.lang.String encoding)
Description copied from class:WS.HttpResponseget the response body as a string- Specified by:
getStringin classWS.HttpResponse- Parameters:
encoding- string charset encoding- Returns:
- the body of the http response
-
getStream
public java.io.InputStream getStream()
get the response as a stream- Specified by:
getStreamin classWS.HttpResponse- Returns:
- an inputstream
-
-