- java.lang.Object
-
- com.github.alexdlaird.http.Response<T>
-
public class Response<T> extends java.lang.ObjectA response from theHttpClient.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetBody()Get the body of the response.java.lang.StringgetBodyRaw()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.intgetStatusCode()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.
-
-