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

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

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

WebRequest.getURL介绍

[英]Returns the final URL associated with this web request.
[中]返回与此web请求关联的最终URL。

代码示例

代码示例来源:origin: webx/citrus

public void request(WebRequest webRequest) {
  try {
    invocationContext = client.newInvocation(webRequest);
    rawRequest = new MyHttpRequest(invocationContext.getRequest(), webRequest.getURL().toExternalForm());
    rawResponse = new MyHttpResponse(invocationContext.getResponse());
    servletContext = invocationContext.getServlet().getServletConfig().getServletContext();
  } catch (RuntimeException e) {
    throw e;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  if (requestContexts != null) {
    requestContext = requestContexts.getRequestContext(servletContext, rawRequest, rawResponse);
  }
}

代码示例来源:origin: webx/citrus

public void request(WebRequest webRequest) {
  try {
    invocationContext = client.newInvocation(webRequest);
    rawRequest = new MyHttpRequest(invocationContext.getRequest(), webRequest.getURL().toExternalForm());
    rawResponse = new MyHttpResponse(invocationContext.getResponse());
    servletContext = invocationContext.getServlet().getServletConfig().getServletContext();
  } catch (RuntimeException e) {
    throw e;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  if (requestContexts != null) {
    requestContext = requestContexts.getRequestContext(servletContext, rawRequest, rawResponse);
  }
}

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

/**
 * Constructs a web request using a base request and a relative URL string.
 **/
protected WebRequest( WebRequest baseRequest, String urlString, String target ) throws MalformedURLException {
  this( baseRequest.getURL(), urlString, target );
}

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

/**
 * Constructs a web request using a base request and a relative URL string.
 **/
protected WebRequest( WebRequest baseRequest, String urlString, String target ) throws MalformedURLException {
  this( baseRequest.getURL(), urlString, target );
}

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

/**
 * Constructs a web request using a base request and a relative URL string.
 **/
protected WebRequest( WebRequest baseRequest, String urlString, String target ) throws MalformedURLException {
  this( baseRequest.getURL(), urlString, target );
}

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

private String getRequestUri() {
  try {
    return null == _request ? null : _request.getURL().getFile();
  } catch (MalformedURLException e) {
    return null;
  }
}

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

private String getRequestUri() {
  try {
    return null == _request ? null : _request.getURL().getFile();
  } catch (MalformedURLException e) {
    return null;
  }
}

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

private String getRequestUri() {
  try {
    return null == _request ? null : _request.getURL().getFile();
  } catch (MalformedURLException e) {
    return null;
  }
}

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

HttpWebResponse( WebConversation client, FrameSelector frame, WebRequest request, URLConnection connection, boolean throwExceptionOnError ) throws IOException {
  this( client, frame, request.getURL(), connection, throwExceptionOnError );
  _referer = request.getReferer();
}

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

protected WebResponse submitRequest( String event, WebRequest request ) throws IOException, SAXException {
  try {
    return super.submitRequest( event, request );
  } catch (UnknownServiceException e) {
    throw new UnsupportedActionException( "HttpUnit does not support " + request.getURL().getProtocol() + " URLs in form submissions" );
  }
}

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

protected WebResponse submitRequest( String event, WebRequest request ) throws IOException, SAXException {
  try {
    return super.submitRequest( event, request );
  } catch (UnknownServiceException e) {
    throw new UnsupportedActionException( "HttpUnit does not support " + request.getURL().getProtocol() + " URLs in form submissions" );
  }
}

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

protected WebResponse submitRequest( String event, WebRequest request ) throws IOException, SAXException {
  try {
    return super.submitRequest( event, request );
  } catch (UnknownServiceException e) {
    throw new UnsupportedActionException( "HttpUnit does not support " + request.getURL().getProtocol() + " URLs in form submissions" );
  }
}

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

private URL getReference() {
    try {
      return getRequest().getURL();
    } catch (MalformedURLException e) {
      return WebLink.this.getBaseURL();
    }
  }
}

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

private URL getReference() {
    try {
      return getRequest().getURL();
    } catch (MalformedURLException e) {
      return WebLink.this.getBaseURL();
    }
  }
}

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

private URL getReference() {
    try {
      return getRequest().getURL();
    } catch (MalformedURLException e) {
      return WebLink.this.getBaseURL();
    }
  }
}

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

InvocationContext newInvocation( WebRequest request, FrameSelector frame ) throws IOException, MalformedURLException {
  ByteArrayOutputStream baos = getMessageBody( request );
  return _invocationContextFactory.newInvocation( this, frame, request, getHeaderFields( request.getURL() ), baos.toByteArray() );
}

代码示例来源:origin: org.opencadc/cadc-test-uws

protected WebResponse execute(WebConversation conversation, final WebRequest request) 
  throws IOException, SAXException
{
  // execute the operation
  WebResponse response = conversation.getResponse(request);
  assertNotNull("POST response to " + request.getURL().toString() + " is null", response);
  log.debug(Util.getResponseHeaders(response));
  log.debug("Response code: " + response.getResponseCode());
  // handle potential redirects
  response = getRedirectResponse(conversation, request, response);
  return response;
}

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

/**
 * Creates a web response object which represents the response to the specified web request.
 **/
protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException,IOException {
  try {
    InvocationContext invocation = newInvocation( request, targetFrame );
    invocation.service();
    return invocation.getServletResponse();
  } catch (ServletException e) {
    throw new HttpInternalErrorException( request.getURL(), e );
  }
}

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

/**
 * Creates a web response object which represents the response to the specified web request.
 **/
protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException,IOException {
  try {
    InvocationContext invocation = newInvocation( request, targetFrame );
    invocation.service();
    return invocation.getServletResponse();
  } catch (ServletException e) {
    throw new HttpInternalErrorException( request.getURL(), e );
  }
}

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

/**
 * Creates a web response object which represents the response to the specified web request.
 **/
protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException,IOException {
  try {
    InvocationContext invocation = newInvocation( request, targetFrame );
    invocation.service();
    return invocation.getServletResponse();
  } catch (ServletException e) {
    throw new HttpInternalErrorException( request.getURL(), e );
  }
}

相关文章