Search in sources :

Example 6 with TraceMethod

use of org.apache.commons.httpclient.methods.TraceMethod in project camel by apache.

the class NettyHttpTraceDisabledTest method testTraceEnabled.

@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();
}
Also used : HttpClient(org.apache.commons.httpclient.HttpClient) TraceMethod(org.apache.commons.httpclient.methods.TraceMethod) Test(org.junit.Test)

Example 7 with TraceMethod

use of org.apache.commons.httpclient.methods.TraceMethod in project alfresco-remote-api by Alfresco.

the class PublicApiHttpClient method trace.

public HttpResponse trace(final RequestContext rq, Binding cmisBinding, String version, String cmisOperation) throws IOException {
    RestApiEndpoint endpoint = new RestApiEndpoint(rq.getNetworkId(), cmisBinding, version, cmisOperation, null);
    String url = endpoint.getUrl();
    TraceMethod req = new TraceMethod(url.toString());
    return submitRequest(req, rq);
}
Also used : TraceMethod(org.apache.commons.httpclient.methods.TraceMethod)

Aggregations

TraceMethod (org.apache.commons.httpclient.methods.TraceMethod)7 HttpClient (org.apache.commons.httpclient.HttpClient)6 Test (org.junit.Test)6