Class HTTPResponse
- java.lang.Object
-
- com.inductiveautomation.snap.websites.HTTPResponse
-
public class HTTPResponse extends java.lang.Object
A class to represent an HTTP response.
-
-
Field Summary
Fields Modifier and Type Field Description static int
BAD_REQUEST
static int
FORBIDDEN
static int
NOT_FOUND
static int
OK
static int
UNAUTHORIZED
-
Constructor Summary
Constructors Constructor Description HTTPResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeader(java.lang.String aKey, java.lang.String aValue)
Adds a header for key.byte[]
getBytes()
Returns the bytes.int
getCode()
Returns the response return code.java.lang.String
getContentType()
Returns the content type.java.util.List<java.lang.String>
getCookies()
Returns the cookies.java.lang.String
getCookieString()
Returns the cookie string.java.util.List<HTTPRequest.Header>
getHeaders()
Returns the headers.java.lang.String
getHeaderString()
Returns the headers as a string.java.lang.String
getMessage()
Returns the response return message.long
getResponseTime()
Returns the response time in milliseconds.java.lang.String
getSummary()
Returns a response summary string.java.lang.String
getText()
Returns the response byte string.java.lang.String
toString()
Returns a string representation.
-
-
-
Field Detail
-
OK
public static final int OK
- See Also:
- Constant Field Values
-
BAD_REQUEST
public static final int BAD_REQUEST
- See Also:
- Constant Field Values
-
UNAUTHORIZED
public static final int UNAUTHORIZED
- See Also:
- Constant Field Values
-
FORBIDDEN
public static final int FORBIDDEN
- See Also:
- Constant Field Values
-
NOT_FOUND
public static final int NOT_FOUND
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCode
public int getCode()
Returns the response return code.
-
getMessage
public java.lang.String getMessage()
Returns the response return message.
-
getHeaders
public java.util.List<HTTPRequest.Header> getHeaders()
Returns the headers.
-
addHeader
public void addHeader(java.lang.String aKey, java.lang.String aValue)
Adds a header for key.
-
getHeaderString
public java.lang.String getHeaderString()
Returns the headers as a string.
-
getCookies
public java.util.List<java.lang.String> getCookies()
Returns the cookies.
-
getCookieString
public java.lang.String getCookieString()
Returns the cookie string.
-
getContentType
public java.lang.String getContentType()
Returns the content type.
-
getBytes
public byte[] getBytes()
Returns the bytes.
-
getText
public java.lang.String getText()
Returns the response byte string.
-
getResponseTime
public long getResponseTime()
Returns the response time in milliseconds.
-
getSummary
public java.lang.String getSummary()
Returns a response summary string.
-
toString
public java.lang.String toString()
Returns a string representation.- Overrides:
toString
in classjava.lang.Object
-
-