public class HttpResponse extends MimeMessage implements java.io.Serializable
Example Usage:
Http http = new Http(); HttpRequest request = new HttpRequest("http://www.myserver.com","GET"); HttpResponse response = http.getResponse(request);
Constructor and Description |
---|
HttpResponse(byte[] message)
Creates a new HttpResponse object.
|
Modifier and Type | Method and Description |
---|---|
int |
getContentLength()
Gets value of Content-Length header in HTTP response representing the
total number of bytes in HTTP response
|
java.lang.String |
getContentType()
Gets value of Content-Type header in HTTP response
|
java.util.Enumeration |
getCookies()
Gets all cookies sent back by HTTP server.
|
java.util.Date |
getDate()
Gets Date header from HTTP response representing the date the response
was issued.
|
java.util.Date |
getExpires()
Gets the Expires header from HTTP response representing the date the
content is set to expire for caching purposes.
|
java.lang.String |
getHttpVersion()
Gets HTTP version sent in response.
|
java.util.Date |
getLastModified()
Gets Last-Modified header from HTTP response representing the date the
content received was last modified.
|
int |
getResponseCode()
Gets response code returned in HTTP response.
|
addHeader, addHeader, addPart, addReplaceHeader, addReplaceHeader, getBody, getBodyAsFile, getBodyData, getBoundary, getContentTransferEncoding, getHeader, getHeaders, getHeaders, getHeaderValue, getMessage, getPart, getParts, getRawBodyData, removeHeader, removePart, removeParts, setBody, setBody, setBody, setBody, setBodyAsFile, setContentType
public HttpResponse(byte[] message) throws MimeException
message
- the contents of the HTTP responseMimeException
- if a MIME related parsing error occurspublic int getResponseCode()
public java.lang.String getHttpVersion()
public int getContentLength()
public java.lang.String getContentType()
getContentType
in class MimeMessage
public java.util.Date getLastModified()
public java.util.Date getDate()
public java.util.Date getExpires()
public java.util.Enumeration getCookies() throws MimeException
HttpCookie
MimeException
- if an error occurs while parsing HTTP headersCopyright © JSCAPE LLC. 1999-2021. All Rights Reserved