Class WebResponseUtil

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

public class WebResponseUtil extends Object
  • Constructor Details

    • WebResponseUtil

      public WebResponseUtil()
  • Method Details

    • replaceResponseContentType

      public static boolean replaceResponseContentType(com.meterware.httpunit.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.