com.gargoylesoftware.htmlunit
Interface WebResponse

All Known Implementing Classes:
StringWebResponse, WebResponseImpl, WebResponseWrapper

public interface WebResponse

A response from a web server

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

Method Summary
 InputStream getContentAsStream()
          Return the content from the server as an input stream
 String getContentAsString()
          Return the content from the server as a string
 String getContentCharSet()
          Return the content charset value.
 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.
 List getResponseHeaders()
          Return the response headers as a List of NameValuePairs.
 String getResponseHeaderValue(String headerName)
          Return the value of the specified header from this response.
 int getStatusCode()
          Return the status code that was returned by the server
 String getStatusMessage()
          Return the status message that was returned from the server
 URL getUrl()
          Return the URL that was used to load this page.
 

Method Detail

getStatusCode

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

Returns:
See above.

getStatusMessage

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

Returns:
See above

getContentType

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

Returns:
See above

getContentAsString

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

Returns:
See above

getContentAsStream

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

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

getUrl

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

Returns:
The originating URL

getRequestMethod

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

Returns:
the method

getResponseHeaders

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

Returns:
a List of NameValuePairs.

getResponseHeaderValue

String getResponseHeaderValue(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

getLoadTimeInMilliSeconds

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

Returns:
The load time.

getContentCharSet

String getContentCharSet()
Return the content charset value.

Returns:
The charset value.

getResponseBody

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

Returns:
response body.


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.