com.meterware.httpunit.WebResponse.loadResponseText()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中com.meterware.httpunit.WebResponse.loadResponseText()方法的一些代码示例,展示了WebResponse.loadResponseText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebResponse.loadResponseText()方法的具体详情如下:
包路径:com.meterware.httpunit.WebResponse
类名称:WebResponse
方法名:loadResponseText

WebResponse.loadResponseText介绍

暂无

代码示例

代码示例来源:origin: org.kohsuke.httpunit/httpunit

/**
 * Returns the text of the response (excluding headers) as a string. Use this method in preference to 'toString'
 * which may be used to represent internal state of this object.
 **/
public String getText() throws IOException {
  if (_responseText == null) loadResponseText();
  return _responseText;
}

代码示例来源:origin: httpunit/httpunit

/**
 * Returns the text of the response (excluding headers) as a string. Use this method in preference to 'toString'
 * which may be used to represent internal state of this object.
 **/
public String getText() throws IOException {
  if (_responseText == null) loadResponseText();
  return _responseText;
}

代码示例来源:origin: javanettasks/httpunit

/**
 * Returns the text of the response (excluding headers) as a string. Use this method in preference to 'toString'
 * which may be used to represent internal state of this object.
 **/
public String getText() throws IOException {
  if (_responseText == null) loadResponseText();
  return _responseText;
}

代码示例来源:origin: org.kohsuke.httpunit/httpunit

/**
 * Constructs a response object from a servlet response.
 * @param frame the target frame on which the response will be displayed
 * @param url the url from which the response was received
 * @param response the response populated by the servlet
 **/
ServletUnitWebResponse( ServletUnitClient client, FrameSelector frame, URL url, HttpServletResponse response, boolean throwExceptionOnError ) throws IOException {
  super( client, frame, url );
  _response = (ServletUnitHttpResponse) response;
  /** make sure that any IO exception for HTML received page happens here, not later. **/
  if (getResponseCode() < HttpURLConnection.HTTP_BAD_REQUEST || !throwExceptionOnError) {
    defineRawInputStream( new ByteArrayInputStream( _response.getContents() ) );
    if (getContentType().startsWith( "text" )) loadResponseText();
  }
}

代码示例来源:origin: org.kohsuke.httpunit/httpunit

/**
 * Constructs a response object from an input stream.
 * @param frame the target window or frame to which the request should be directed
 * @param url the url from which the response was received
 * @param connection the URL connection from which the response can be read
 **/
HttpWebResponse( WebConversation client, FrameSelector frame, URL url, URLConnection connection, boolean throwExceptionOnError ) throws IOException {
  super( client, frame, url );
  if (HttpUnitOptions.isLoggingHttpHeaders()) System.out.println( "\nReceived from " + url );
  readHeaders( connection );
  /** make sure that any IO exception for HTML received page happens here, not later. **/
  if (_responseCode < HttpURLConnection.HTTP_BAD_REQUEST || !throwExceptionOnError) {
    defineRawInputStream( new BufferedInputStream( getInputStream( connection ) ) );
    if (getContentType().startsWith( "text" )) loadResponseText();
  }
}

相关文章

微信公众号

最新文章

更多

WebResponse类方法