Package play.libs.ws
Class WSUrlFetch.HttpUrlfetchResponse
- java.lang.Object
-
- play.libs.WS.HttpResponse
-
- play.libs.ws.WSUrlFetch.HttpUrlfetchResponse
-
- Enclosing class:
- WSUrlFetch
public static class WSUrlFetch.HttpUrlfetchResponse extends WS.HttpResponse
An HTTP response wrapper
-
-
Constructor Summary
Constructors Constructor Description HttpUrlfetchResponse(java.net.HttpURLConnection connection)
you shouldn't have to create an HttpResponse yourself
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getHeader(java.lang.String key)
java.util.List<Http.Header>
getHeaders()
java.lang.Integer
getStatus()
the HTTP status codejava.lang.String
getStatusText()
the HTTP status textjava.io.InputStream
getStream()
get the response as a streamjava.lang.String
getString()
get the response body as a stringjava.lang.String
getString(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:
getStatus
in classWS.HttpResponse
- Returns:
- the status code of the http response
-
getStatusText
public java.lang.String getStatusText()
the HTTP status text- Specified by:
getStatusText
in classWS.HttpResponse
- Returns:
- the status text of the http response
-
getHeader
public java.lang.String getHeader(java.lang.String key)
- Specified by:
getHeader
in classWS.HttpResponse
-
getHeaders
public java.util.List<Http.Header> getHeaders()
- Specified by:
getHeaders
in classWS.HttpResponse
-
getString
public java.lang.String getString()
get the response body as a string- Specified by:
getString
in classWS.HttpResponse
- Returns:
- the body of the http response
-
getString
public java.lang.String getString(java.lang.String encoding)
Description copied from class:WS.HttpResponse
get the response body as a string- Specified by:
getString
in 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:
getStream
in classWS.HttpResponse
- Returns:
- an inputstream
-
-