public class HTTPResponse extends HTTPPacket
| Constructor and Description |
|---|
HTTPResponse()Creates a new HTTP response with default settings. |
HTTPResponse(HTTPResponse httpRes)Creates a copy of an existing HTTP response. |
HTTPResponse(HTTPSocket httpSock)Creates an HTTP response from an HTTP socket. |
HTTPResponse(InputStream in)Creates an HTTP response by parsing from an input stream. |
| Modifier and Type | Method and Description |
|---|---|
String | getHeader()Return the full header string for this HTTP response. |
int | getStatusCode()Gets the HTTP status code of this response. |
String | getStatusLineString()Gets the status line string of this HTTP response. |
boolean | isSuccessful()Checks if this response has a successful status code. |
void | print()Outputs the full HTTP response to the debug log. |
void | setStatusCode(int code)Sets the HTTP status code of this response. |
String | toString() |
addHeader, addHeader, clearHeaders, getCacheControl, getCharSet, getConnection, getContent, getContentInputStream, getContentLanguage, getContentLength, getContentRange, getContentRangeFirstPosition, getContentRangeInstanceLength, getContentRangeLastPosition, getContentString, getContentType, getDate, getFirstLine, getFirstLineToken, getHeader, getHeader, getHeaderString, getHeaderValue, getHost, getIntegerHeaderValue, getLongHeaderValue, getNHeaders, getServer, getStringHeaderValue, getStringHeaderValue, getTransferEncoding, getVersion, hasConnection, hasContent, hasContentInputStream, hasContentRange, hasFirstLine, hasHeader, hasTransferEncoding, init, isChunked, isCloseConnection, isKeepAliveConnection, read, set, set, set, set, setCacheControl, setCacheControl, setCacheControl, setConnection, setContent, setContent, setContent, setContent, setContentInputStream, setContentLanguage, setContentLength, setContentRange, setContentType, setDate, setHeader, setHeader, setHeader, setHeader, setHost, setIntegerHeader, setLongHeader, setServer, setStringHeader, setStringHeader, setTransferEncoding, setVersionpublic HTTPResponse()
public HTTPResponse(HTTPResponse httpRes)
httpRes - HTTP response to copypublic HTTPResponse(HTTPSocket httpSock)
httpSock - HTTP socket containing the response datapublic HTTPResponse(InputStream in)
in - input stream containing the HTTP responsepublic String getHeader()
public int getStatusCode()
public String getStatusLineString()
public boolean isSuccessful()
public void print()
public void setStatusCode(int code)
code - HTTP status code (e.g., 200, 404, 500)