Package org.apache.commons.httpclient.methods

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


      case POST:
        return new PostMethod(uri);
      case PUT:
        return new PutMethod(uri);
      case TRACE:
        return new TraceMethod(uri);
      case PATCH:
        throw new IllegalArgumentException(
            "HTTP method PATCH not available before Apache HttpComponents HttpClient 4.2");
      default:
        throw new IllegalArgumentException("Invalid HTTP method: " + httpMethod);
View Full Code Here


      case POST:
        return new PostMethod(uri);
      case PUT:
        return new PutMethod(uri);
      case TRACE:
        return new TraceMethod(uri);
      default:
        throw new IllegalArgumentException("Invalid HTTP method: " + httpMethod);
    }
  }
View Full Code Here

            } else if (method.equals(PUT)){
                httpMethod = new PutMethod(urlStr);
            } 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)){
View Full Code Here

    } 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);
    }

    httpMethod.setURI(uri);
View Full Code Here

            } else if (method.equals(PUT)){
                httpMethod = new PutMethod(urlStr);
            } 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)){
View Full Code Here

            } else if (method.equals(PUT)){
                httpMethod = new PutMethod(urlStr);
            } 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)){
View Full Code Here

            } else if (method.equals(PUT)){
                httpMethod = new PutMethod(urlStr);
            } 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)){
View Full Code Here

    private int portTraceOff = getNextPort();

    @Test
    public void testTraceDisabled() throws Exception {       
        HttpClient httpclient = new HttpClient();
        TraceMethod trace = new TraceMethod("http://localhost:" + portTraceOff + "/myservice");
        httpclient.executeMethod(trace);

        // TRACE shouldn't be allowed by default
        assertTrue(trace.getStatusCode() == 405);
        trace.releaseConnection();
    }
View Full Code Here

    }
   
    @Test
    public void testTraceEnabled() throws Exception {       
        HttpClient httpclient = new HttpClient();
        TraceMethod trace = new TraceMethod("http://localhost:" + portTraceOn + "/myservice");
        httpclient.executeMethod(trace);

        // TRACE is now allowed
        assertTrue(trace.getStatusCode() == 200);
        trace.releaseConnection();
    }
View Full Code Here

                break;
            case OPTIONS:
                httpMethod = new OptionsMethod(uri);
                break;
            case TRACE:
                httpMethod = new TraceMethod(uri);
                break;
            default:
                httpMethod = getMethod(new ExtensionMethod(method, uri), entity);
        }
        if (actual != null) {
View Full Code Here

TOP

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

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.