Package org.apache.commons.httpclient.methods

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


            DeleteMethod deleteMethod = new DeleteMethod(encodedPath);
            context.setHttpMethod(deleteMethod);
        }
        else if (ProxyConstants.METHOD_TRACE.equals(method))
        {
            TraceMethod traceMethod = new TraceMethod(encodedPath);
            context.setHttpMethod(traceMethod);
        }
        else
        {
            ProxyException pe = new ProxyException(INVALID_METHOD);
View Full Code Here


                host.setHost(new URI(requestUri, false));
                this.httpMethod = new ConnectMethod(host);
            } else if (method.equalsIgnoreCase(Method.OPTIONS.getName())) {
                this.httpMethod = new OptionsMethod(requestUri);
            } else if (method.equalsIgnoreCase(Method.TRACE.getName())) {
                this.httpMethod = new TraceMethod(requestUri);
            } else {
                this.httpMethod = new EntityEnclosingMethod(requestUri) {
                    @Override
                    public String getName() {
                        return method;
View Full Code Here

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

                host.setHost(new URI(requestUri, false));
                this.httpMethod = new ConnectMethod(host);
            } else if (method.equalsIgnoreCase(Method.OPTIONS.getName())) {
                this.httpMethod = new OptionsMethod(requestUri);
            } else if (method.equalsIgnoreCase(Method.TRACE.getName())) {
                this.httpMethod = new TraceMethod(requestUri);
            } else {
                this.httpMethod = new EntityEnclosingMethod(requestUri) {
                    @Override
                    public String getName() {
                        return method;
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

    }
   
    @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

    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

    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

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.