Class HTTPResponse
- java.lang.Object
-
- com.inductiveautomation.snap.websites.HTTPResponse
-
public class HTTPResponse extends java.lang.ObjectA class to represent an HTTP response.
-
-
Field Summary
Fields Modifier and Type Field Description static intBAD_REQUESTstatic intFORBIDDENstatic intNOT_FOUNDstatic intOKstatic intUNAUTHORIZED
-
Constructor Summary
Constructors Constructor Description HTTPResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(java.lang.String aKey, java.lang.String aValue)Adds a header for key.byte[]getBytes()Returns the bytes.intgetCode()Returns the response return code.java.lang.StringgetContentType()Returns the content type.java.util.List<java.lang.String>getCookies()Returns the cookies.java.lang.StringgetCookieString()Returns the cookie string.java.util.List<HTTPRequest.Header>getHeaders()Returns the headers.java.lang.StringgetHeaderString()Returns the headers as a string.java.lang.StringgetMessage()Returns the response return message.longgetResponseTime()Returns the response time in milliseconds.java.lang.StringgetSummary()Returns a response summary string.java.lang.StringgetText()Returns the response byte string.java.lang.StringtoString()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:
toStringin classjava.lang.Object
-
-