org.apache.cactus
Class WebResponse
java.lang.Object
|
+--org.apache.cactus.WebResponse
- public class WebResponse
- extends java.lang.Object
Default web response implementation that provides a minimal
API for asserting returned output stream from the server side. For more
complex assertions, use an com.meterware.httpunit.WebResponse
instead as parameter of your endXXX()
methods.
- Version:
- $Id: WebResponse.java,v 1.9 2001/09/16 11:11:58 vmassol Exp $
- Author:
- Vincent Massol
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebResponse
public WebResponse(WebRequest theRequest,
java.net.HttpURLConnection theConnection)
- Parameters:
theRequest
- the request data that were used to open the
connection to the server.theConnection
- the original HttpURLConnection
used
to call the URL
getConnection
public java.net.HttpURLConnection getConnection()
- Returns:
- the original
HttpURLConnection
used to call the
URL
getWebRequest
public WebRequest getWebRequest()
- Returns:
- the request data the were used to open the connection to the
server
getText
public java.lang.String getText()
- Returns:
- the text of the response (excluding headers) as a string.
getTextAsArray
public java.lang.String[] getTextAsArray()
- Returns:
- the text of the response (excluding headers) as an array of
strings (each string is a separate line from the output stream).
getInputStream
public java.io.InputStream getInputStream()
- Returns:
- a buffered input stream for reading the response data.
getCookie
public Cookie getCookie(java.lang.String theName)
- Return the first cookie found that has the specified name or null
if not found.
- Parameters:
theName
- the cookie name to find- Returns:
- the cookie or null if not found
getCookies
public Cookie[] getCookies()
- Returns:
- the cookies returned by the server
Copyright © 2000-2001 Apache Software Foundation. All Rights Reserved.