- java.lang.Object
-
- net.dongliu.cute.http.HTTPResponse<T>
-
public class HTTPResponse<T> extends Object
Http Response with body be transformed- 作者:
- Liu Dong
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Tbody()Return the response body.HTTPCookiescookies()Get all cookies returned by this response.HTTPHeadersheaders()Get all response headersintstatusCode()Return http response status code.<R> HTTPResponse<R>transform(Function<T,R> transformer)Return a new Response, with body is the result apply transformer on the original response body.URLurl()Get actual url (redirected)
-
-
-
方法详细资料
-
url
public URL url()
Get actual url (redirected)
-
statusCode
public int statusCode()
Return http response status code.- 返回:
- the status code
-
cookies
public HTTPCookies cookies()
Get all cookies returned by this response.- 返回:
- a immutable list of cookies
-
headers
public HTTPHeaders headers()
Get all response headers
-
body
public T body()
Return the response body.- 返回:
- The response body
-
transform
public <R> HTTPResponse<R> transform(Function<T,R> transformer)
Return a new Response, with body is the result apply transformer on the original response body.- 类型参数:
R- the response body type- 参数:
transformer- the function to convert response body
-
-