Class HTTPResponse
- java.lang.Object
- 
- com.inductiveautomation.snap.websites.HTTPResponse
 
- 
 public class HTTPResponse extends java.lang.ObjectA class to represent an HTTP response.
- 
- 
Field SummaryFields Modifier and Type Field Description static intBAD_REQUESTstatic intFORBIDDENstatic intNOT_FOUNDstatic intOKstatic intUNAUTHORIZED
 - 
Constructor SummaryConstructors Constructor Description HTTPResponse()
 - 
Method SummaryAll 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- 
OKpublic static final int OK - See Also:
- Constant Field Values
 
 - 
BAD_REQUESTpublic static final int BAD_REQUEST - See Also:
- Constant Field Values
 
 - 
UNAUTHORIZEDpublic static final int UNAUTHORIZED - See Also:
- Constant Field Values
 
 - 
FORBIDDENpublic static final int FORBIDDEN - See Also:
- Constant Field Values
 
 - 
NOT_FOUNDpublic static final int NOT_FOUND - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getCodepublic int getCode() Returns the response return code.
 - 
getMessagepublic java.lang.String getMessage() Returns the response return message.
 - 
getHeaderspublic java.util.List<HTTPRequest.Header> getHeaders() Returns the headers.
 - 
addHeaderpublic void addHeader(java.lang.String aKey, java.lang.String aValue)Adds a header for key.
 - 
getHeaderStringpublic java.lang.String getHeaderString() Returns the headers as a string.
 - 
getCookiespublic java.util.List<java.lang.String> getCookies() Returns the cookies.
 - 
getCookieStringpublic java.lang.String getCookieString() Returns the cookie string.
 - 
getContentTypepublic java.lang.String getContentType() Returns the content type.
 - 
getBytespublic byte[] getBytes() Returns the bytes.
 - 
getTextpublic java.lang.String getText() Returns the response byte string.
 - 
getResponseTimepublic long getResponseTime() Returns the response time in milliseconds.
 - 
getSummarypublic java.lang.String getSummary() Returns a response summary string.
 - 
toStringpublic java.lang.String toString() Returns a string representation.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-