public.javadoc.org.spincast.plugins.httpclient.HttpResponse.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
HttpResponse (org.spincast:spincast-framework 2.1.1 API)
Package org.spincast.plugins.httpclient
Interface HttpResponse
- All Known Implementing Classes:
HttpResponseDefault
public interface HttpResponse
-
Method Summary
Modifier and Type
Method
Description
byte[]
Get the content as byte[]
.
Gets the content as a JsonObject.
Gets the content as a UTF-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 a UTF-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 as byte[]
.