Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.OptionsMethod


      case DELETE:
        return new DeleteMethod(uri);
      case HEAD:
        return new HeadMethod(uri);
      case OPTIONS:
        return new OptionsMethod(uri);
      case POST:
        return new PostMethod(uri);
      case PUT:
        return new PutMethod(uri);
      case TRACE:
View Full Code Here


            } else if (method.equals(HEAD)){
                httpMethod = new HeadMethod(urlStr);
            } else if (method.equals(TRACE)){
                httpMethod = new TraceMethod(urlStr);
            } else if (method.equals(OPTIONS)){
                httpMethod = new OptionsMethod(urlStr);
            } else if (method.equals(DELETE)){
                httpMethod = new DeleteMethod(urlStr);
            } else if (method.equals(GET)){
                httpMethod = new GetMethod(urlStr);
            } else {
View Full Code Here

    } else if (method.equalsIgnoreCase(PUT)) {
      httpMethod = new PutMethod();
    } else if (method.equalsIgnoreCase(HEAD)) {
      httpMethod = new HeadMethod();
    } else if (method.equalsIgnoreCase(OPTIONS)) {
      httpMethod = new OptionsMethod();
    } else if (method.equalsIgnoreCase(TRACE)) {
      httpMethod = new TraceMethod(uri.toString());
    } else {
      httpMethod = new GenericMethod(method);
    }
View Full Code Here

     * but Tomcat 3.x is not.
     */
    public void testMethodsOptions() {

        HttpClient client = createHttpClient();
        OptionsMethod method = new OptionsMethod("/");

        try {
            client.executeMethod(method);
        } catch (Throwable t) {
            t.printStackTrace();
            fail("Unable to execute method : " + t.toString());
        }

        Enumeration methodsAllowed = method.getAllowedMethods();
        // This enumeration musn't be empty
        assertTrue("No HTTP method allowed : result of OPTIONS is incorrect "
               + "(make sure the webserver running on port " + getPort()
               + " supports OPTIONS properly)",
               methodsAllowed.hasMoreElements());
View Full Code Here

    public void testMethodsHead() {

        HttpClient client = createHttpClient();

        OptionsMethod opmethod = new OptionsMethod("/");

        try {
            client.executeMethod(opmethod);
        } catch (Throwable t) {
            t.printStackTrace();
View Full Code Here

  private synchronized void doOptions(String url) throws NotFoundException, java.net.ConnectException, Unauthorized, java.net.UnknownHostException, SocketTimeoutException, IOException, com.ettrema.httpclient.HttpException {
    notifyStartRequest();
    String uri = urlEncode(url);
    log.trace("doOptions: {}", url);
    OptionsMethod m = new OptionsMethod(uri);
    InputStream in = null;
    try {
      int res = client.executeMethod(m);
      log.trace("result code: " + res);
      if (res == 301 || res == 302) {
        return;
      }
      Utils.processResultCode(res, url);
    } finally {
      Utils.close(in);
      m.releaseConnection();
      notifyFinishRequest();
    }
  }
View Full Code Here

            } else if (method.equals(HEAD)){
                httpMethod = new HeadMethod(urlStr);
            } else if (method.equals(TRACE)){
                httpMethod = new TraceMethod(urlStr);
            } else if (method.equals(OPTIONS)){
                httpMethod = new OptionsMethod(urlStr);
            } else if (method.equals(DELETE)){
                httpMethod = new DeleteMethod(urlStr);
            } else if (method.equals(GET)){
                httpMethod = new GetMethod(urlStr);
                final CacheManager cacheManager = getCacheManager();
View Full Code Here

            } else if (method.equals(HEAD)){
                httpMethod = new HeadMethod(urlStr);
            } else if (method.equals(TRACE)){
                httpMethod = new TraceMethod(urlStr);
            } else if (method.equals(OPTIONS)){
                httpMethod = new OptionsMethod(urlStr);
            } else if (method.equals(DELETE)){
                httpMethod = new DeleteMethod(urlStr);
            } else if (method.equals(GET)){
                httpMethod = new GetMethod(urlStr);
            } else {
View Full Code Here

            } else if (method.equals(HEAD)){
                httpMethod = new HeadMethod(urlStr);
            } else if (method.equals(TRACE)){
                httpMethod = new TraceMethod(urlStr);
            } else if (method.equals(OPTIONS)){
                httpMethod = new OptionsMethod(urlStr);
            } else if (method.equals(DELETE)){
                httpMethod = new DeleteMethod(urlStr);
            } else if (method.equals(GET)){
                httpMethod = new GetMethod(urlStr);
            } else {
View Full Code Here

                break;
            case HEAD:
                httpMethod = new HeadMethod(uri);
                break;
            case OPTIONS:
                httpMethod = new OptionsMethod(uri);
                break;
            case TRACE:
                httpMethod = new TraceMethod(uri);
                break;
            default:
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.methods.OptionsMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.