com.gargoylesoftware.htmlunit
Interface WebResponse

All Known Implementing Classes:
StringWebResponse, WebResponseImpl, WebResponseWrapper

public interface WebResponse

A response from a web server

Version:
$Revision: 1.3 $
Author:
Mike Bowler, Noboru Sinohara, Marc Guillemot

Method Summary
 java.io.InputStream getContentAsStream()
 Return the content from the server as an input stream
 java.lang.String getContentAsString()
 Return the content from the server as a string
 java.lang.String getContentCharSet()
 Return the content charset value.
 java.lang.String getContentType()
 Return the content type returned from the server.
 long getLoadTimeInMilliSeconds()
 Return the time it took to load this web response in milliseconds.
 SubmitMethod getRequestMethod()
 Return the method used for the request resulting into this response.
 byte[] getResponseBody()
 Return the response body as byte array.
 java.util.List getResponseHeaders()
 Return the response headers as a List of NameValuePairs.
 java.lang.String getResponseHeaderValue(java.lang.String headerName)
 Return the value of the specified header from this response.
 int getStatusCode()
 Return the status code that was returned by the server
 java.lang.String getStatusMessage()
 Return the status message that was returned from the server
 java.net.URL getUrl()
 Return the URL that was used to load this page.
 

Method Detail

getContentAsStream

java.io.InputStream getContentAsStream()
                                       throws java.io.IOException
Return the content from the server as an input stream

Returns:
See above
Throws:
java.io.IOException - If an IO problem occurs

getContentAsString

java.lang.String getContentAsString()
Return the content from the server as a string

Returns:
See above

getContentCharSet

java.lang.String getContentCharSet()
Return the content charset value.

Returns:
The charset value.

getContentType

java.lang.String getContentType()
Return the content type returned from the server. Ie "text/html"

Returns:
See above

getLoadTimeInMilliSeconds

long getLoadTimeInMilliSeconds()
Return the time it took to load this web response in milliseconds.

Returns:
The load time.

getRequestMethod

SubmitMethod getRequestMethod()
Return the method used for the request resulting into this response.

Returns:
the method

getResponseBody

byte[] getResponseBody()
Return the response body as byte array.

Returns:
response body.

getResponseHeaders

java.util.List getResponseHeaders()
Return the response headers as a List of NameValuePairs.

Returns:
a List of NameValuePairs.

getResponseHeaderValue

java.lang.String getResponseHeaderValue(java.lang.String headerName)
Return the value of the specified header from this response.

Parameters:
headerName - The name of the header
Returns:
The value of the specified header

getStatusCode

int getStatusCode()
Return the status code that was returned by the server

Returns:
See above.

getStatusMessage

java.lang.String getStatusMessage()
Return the status message that was returned from the server

Returns:
See above

getUrl

java.net.URL getUrl()
Return the URL that was used to load this page.

Returns:
The originating URL


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.