Package play.libs.ws
Class DummyHttpResponse
- java.lang.Object
-
- play.libs.ws.HttpResponse
-
- play.libs.ws.DummyHttpResponse
-
public class DummyHttpResponse extends HttpResponse
-
-
Constructor Summary
Constructors Constructor Description DummyHttpResponse(int status, java.lang.String body, Http.Header... headers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHeader(java.lang.String name)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.nio.charset.Charset encoding)get the response body as a stringjava.lang.StringtoString()-
Methods inherited from class play.libs.ws.HttpResponse
getContentType, getEncoding, getJson, getQueryString, getXml, getXml, success
-
-
-
-
Constructor Detail
-
DummyHttpResponse
public DummyHttpResponse(int status, java.lang.String body, Http.Header... headers)
-
-
Method Detail
-
getStatus
public java.lang.Integer getStatus()
Description copied from class:HttpResponsethe HTTP status code- Specified by:
getStatusin classHttpResponse- Returns:
- the status code of the http response
-
getStatusText
public java.lang.String getStatusText()
Description copied from class:HttpResponseThe HTTP status text- Specified by:
getStatusTextin classHttpResponse- Returns:
- the status text of the http response
-
getHeader
@Nullable public java.lang.String getHeader(java.lang.String name)
- Specified by:
getHeaderin classHttpResponse
-
getHeaders
public java.util.List<Http.Header> getHeaders()
- Specified by:
getHeadersin classHttpResponse
-
getString
public java.lang.String getString()
Description copied from class:HttpResponseget the response body as a string- Specified by:
getStringin classHttpResponse- Returns:
- the body of the http response
-
getString
public java.lang.String getString(java.nio.charset.Charset encoding)
Description copied from class:HttpResponseget the response body as a string- Specified by:
getStringin classHttpResponse- Parameters:
encoding- string charset encoding- Returns:
- the body of the http response
-
getStream
public java.io.InputStream getStream()
Description copied from class:HttpResponseget the response as a stream+ this method can only be called onced because async implementation does not allow it to be called + multiple times +
- Specified by:
getStreamin classHttpResponse- Returns:
- an inputstream
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-