- java.lang.Object
-
- com.github.alexdlaird.http.Response<T>
-
public class Response<T> extends java.lang.Object
A response from theHttpClient
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getBody()
Get the body of the response.java.lang.String
getBodyRaw()
Get the raw body of the response (can be useful if parsing fails).java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getHeaderFields()
Get the response headers.int
getStatusCode()
Get the response code.
-
-
-
Constructor Detail
-
Response
public Response(int statusCode, T body, java.lang.String bodyRaw, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headerFields)
Construct a response.- Parameters:
statusCode
- The response code.body
- The body of the response.bodyRaw
- The unparsed body of the response.headerFields
- Header fields in the response.
-
-
Method Detail
-
getStatusCode
public int getStatusCode()
Get the response code.
-
getBody
public T getBody()
Get the body of the response.
-
getBodyRaw
public java.lang.String getBodyRaw()
Get the raw body of the response (can be useful if parsing fails).
-
getHeaderFields
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFields()
Get the response headers.
-
-