Package org.spincast.plugins.httpclient
Interface HttpResponse
- All Known Implementing Classes:
HttpResponseDefault
public interface HttpResponse
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Get the content asbyte[]
.Gets the content as a JsonObject.Gets the content as aUTF-8
String.getContentAsString
(String encoding) Gets the content as a String using the specified encoding.Gets the Content-Type.Gets a cookie.Gets the cookies.getCookieValue
(String name) Gets the value of a cookie.Gets an header.getHeaderFirst
(String name) Gets the first value of an header.Gets the headers.int
Gets the HTTP status.boolean
Is the response gzipped?
-
Method Details
-
getStatus
int getStatus()Gets the HTTP status. -
getContentType
String getContentType()Gets the Content-Type. -
getHeaders
Gets the headers. -
getHeader
Gets an header. An header can have more than one value. -
getHeaderFirst
Gets the first value of an header. -
getCookies
Gets the cookies. -
getCookie
Gets a cookie. -
getCookieValue
Gets the value of a cookie.- Returns:
- the value of the cookie or
null
if the cookie doesn't exist.
-
isGzipped
boolean isGzipped()Is the response gzipped? -
getContentAsString
String getContentAsString()Gets the content as aUTF-8
String. -
getContentAsString
Gets the content as a String using the specified encoding. -
getContentAsJsonObject
JsonObject getContentAsJsonObject()Gets the content as a JsonObject. This expects the content to be a valid Json string or an exception is thrown. -
getContentAsByteArray
byte[] getContentAsByteArray()Get the content asbyte[]
.
-