Class StringWebResponse
java.lang.Object
org.htmlunit.WebResponse
org.htmlunit.StringWebResponse
- All Implemented Interfaces:
Serializable
A simple WebResponse created from a string. Content is assumed to be of type
text/html.- Author:
- Mike Bowler, Marc Guillemot, Brad Clarke, Ahmed Ashour, Ronald Brill, Carsten Steul
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStringWebResponse(String content, URL originatingURL) Creates an instance associated with the specified originating URL.StringWebResponse(String content, Charset charset, URL originatingURL) Creates an instance associated with the specified originating URL. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the fromJavascript property.voidsetFromJavascript(boolean fromJavascript) Sets the fromJavascript_ property.Methods inherited from class WebResponse
cleanUp, defaultCharsetUtf8, getBlockReason, getContentAsStream, getContentAsStreamWithBomIfApplicable, getContentAsString, getContentAsString, getContentCharset, getContentCharsetOrNull, getContentLength, getContentType, getHeaderContentCharset, getLoadTime, getResponseHeaders, getResponseHeaderValue, getStatusCode, getStatusMessage, getWebRequest, isSuccess, isSuccessOrUseProxy, isSuccessOrUseProxyOrNotModified, markAsBlocked, wasBlocked, wasContentCharsetTentative
-
Constructor Details
-
StringWebResponse
-
StringWebResponse
-
-
Method Details
-
isFromJavascript
public boolean isFromJavascript()Returns the fromJavascript property. This is true, if the response was created from javascript (usually document.write).- Returns:
- the from fromJavascript_
-
setFromJavascript
public void setFromJavascript(boolean fromJavascript) Sets the fromJavascript_ property. Set this to true, if the response was created from javascript (usually document.write).- Parameters:
fromJavascript- the new fromJavascript
-