public class

WebResponseUtil

extends Object
java.lang.Object
   ↳ com.meterware.httpunit.WebResponseUtil

Summary

Public Constructors
WebResponseUtil()
Public Methods
static boolean replaceResponseContentType(WebResponse webResponse, String contentType)
This method takes a given webResponse and replaces the content type with the one supplied.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WebResponseUtil ()

Public Methods

public static boolean replaceResponseContentType (WebResponse webResponse, String contentType)

This method takes a given webResponse and replaces the content type with the one supplied. This is useful for writing func tests that look at Excel or Word HTML which do not have the 'text/html' content type. HTTPUnit can only deal with 'text/html' content types.

This needs to be in teh com.meterware.httpunit package, since the replaceText method() only has package level access.

Parameters
webResponse The webResponse object returned by the request.
contentType The new content type.
Returns
  • True if the replace was successful. False if the webResponse could not be parsed.