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

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

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

WebRequest.getMethod介绍

暂无

代码示例

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

/**
 * Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 **/
public String getMethod() {
  return _request.getMethod();
}

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

private String getMethod() {
  return null == _request ? null : _request.getMethod();
}

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

/**
 * Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 **/
public String getMethod() {
  return _request.getMethod();
}

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

/**
 * Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
 **/
public String getMethod() {
  return _request.getMethod();
}

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

private String getMethod() {
  return null == _request ? null : _request.getMethod();
}

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

private String getMethod() {
  return null == _request ? null : _request.getMethod();
}

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

/**
 * Performs any additional processing necessary to complete the request.
 **/
protected void completeRequest( URLConnection connection ) throws IOException {
  if (connection instanceof HttpURLConnection) ((HttpURLConnection) connection).setRequestMethod( getMethod() );
}

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

/**
 * Performs any additional processing necessary to complete the request.
 **/
protected void completeRequest( URLConnection connection ) throws IOException {
  if (connection instanceof HttpURLConnection) ((HttpURLConnection) connection).setRequestMethod( getMethod() );
}

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

/**
 * Performs any additional processing necessary to complete the request.
 **/
protected void completeRequest( URLConnection connection ) throws IOException {
  if (connection instanceof HttpURLConnection) ((HttpURLConnection) connection).setRequestMethod( getMethod() );
}

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

public String toString() {
  return getMethod() + " request for (" + getURLBase() + ") " + getURLString();
}

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

public String toString() {
  return getMethod() + " request for (" + getURLBase() + ") " + getURLString();
}

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

public String toString() {
  return getMethod() + " request for (" + getURLBase() + ") " + getURLString();
}

代码示例来源: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 {
  Properties savedProperties = (Properties) System.getProperties().clone();
  try {
    if (_proxyHost != null) {
      System.setProperty( "proxyHost", _proxyHost );
      System.setProperty( "proxyPort", Integer.toString( _proxyPort ) );
    }
    URLConnection connection = openConnection( getRequestURL( request ) );
    // [ 1518901 ] enable http connect and read timeouts (needs JDK 1.5)
    // XXX enable for 1.7 release in 2008
    // comment out if you need this and have JDK 1.5
    // if (_connectTimeout>=0) connection.setConnectTimeout( _connectTimeout );
    // if (_readTimeout>=0)    connection.setReadTimeout( _readTimeout );            
    if (HttpUnitOptions.isLoggingHttpHeaders()) {
      String urlString = request.getURLString();
      System.out.println( "\nConnecting to " + request.getURL().getHost() );
      System.out.println( "Sending:: " + request.getMethod() + " " + urlString );
    }
    sendHeaders( connection, getHeaderFields( request.getURL() ) );
    sendHeaders( connection, request.getHeaderDictionary() );
    request.completeRequest( connection );
    return new HttpWebResponse( this, targetFrame, request, connection, getExceptionsThrownOnErrorStatus() );
  } finally {
    System.setProperties( savedProperties );
  }
}

代码示例来源: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 {
  Properties savedProperties = (Properties) System.getProperties().clone();
  try {
    if (_proxyHost != null) {
      System.setProperty( "proxyHost", _proxyHost );
      System.setProperty( "proxyPort", Integer.toString( _proxyPort ) );
    }
    URLConnection connection = openConnection( getRequestURL( request ) );
    // [ 1518901 ] enable http connect and read timeouts (needs JDK 1.5)
    // XXX enable for 1.7 release in 2008
    // comment out if you need this and have JDK 1.5
    // if (_connectTimeout>=0) connection.setConnectTimeout( _connectTimeout );
    // if (_readTimeout>=0)    connection.setReadTimeout( _readTimeout );            
    if (HttpUnitOptions.isLoggingHttpHeaders()) {
      String urlString = request.getURLString();
      System.out.println( "\nConnecting to " + request.getURL().getHost() );
      System.out.println( "Sending:: " + request.getMethod() + " " + urlString );
    }
    sendHeaders( connection, getHeaderFields( request.getURL() ) );
    sendHeaders( connection, request.getHeaderDictionary() );
    request.completeRequest( connection );
    return new HttpWebResponse( this, targetFrame, request, connection, getExceptionsThrownOnErrorStatus() );
  } finally {
    System.setProperties( savedProperties );
  }
}

代码示例来源: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 {
  Properties savedProperties = (Properties) System.getProperties().clone();
  try {
    if (_proxyHost != null) {
      System.setProperty( "proxyHost", _proxyHost );
      System.setProperty( "proxyPort", Integer.toString( _proxyPort ) );
    }
    URLConnection connection = openConnection( getRequestURL( request ) );
    // [ 1518901 ] enable http connect and read timeouts (needs JDK 1.5)
    // XXX enable for 1.7 release in 2008
    // comment out if you need this and have JDK 1.5
    // if (_connectTimeout>=0) connection.setConnectTimeout( _connectTimeout );
    // if (_readTimeout>=0)    connection.setReadTimeout( _readTimeout );            
    if (HttpUnitOptions.isLoggingHttpHeaders()) {
      String urlString = request.getURLString();
      System.out.println( "\nConnecting to " + request.getURL().getHost() );
      System.out.println( "Sending:: " + request.getMethod() + " " + urlString );
    }
    sendHeaders( connection, getHeaderFields( request.getURL() ) );
    sendHeaders( connection, request.getHeaderDictionary() );
    request.completeRequest( connection );
    return new HttpWebResponse( this, targetFrame, request, connection, getExceptionsThrownOnErrorStatus() );
  } finally {
    System.setProperties( savedProperties );
  }
}

相关文章