Examples of HttpDelete


Examples of org.apache.http.client.methods.HttpDelete

    public static Request Delete(final URI uri) {
        return new Request(new HttpDelete(uri));
    }

    public static Request Delete(final String uri) {
        return new Request(new HttpDelete(uri));
    }
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

    }

    @Test
    public void testCanFlushCacheEntriesAtUri() throws Exception {
        final HttpHost host = new HttpHost("foo.example.com");
        final HttpRequest req = new HttpDelete("/bar");
        final String key = (new CacheKeyGenerator()).getURI(host, req);
        final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry();

        backing.map.put(key, entry);
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

                ((HttpPost) httpRequest).setEntity(entity);
            }
        }
        else if (HttpDelete.METHOD_NAME.equals(method))
        {
            httpRequest = new HttpDelete(proxyTargetURL);
        }
        else if (HttpOptions.METHOD_NAME.equals(method))
        {
            httpRequest = new HttpOptions(proxyTargetURL);
        }
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

            } else if (method.equals(HTTPConstants.TRACE)) {
                httpRequest = new HttpTrace(uri);
            } else if (method.equals(HTTPConstants.OPTIONS)) {
                httpRequest = new HttpOptions(uri);
            } else if (method.equals(HTTPConstants.DELETE)) {
                httpRequest = new HttpDelete(uri);
            } else if (method.equals(HTTPConstants.GET)) {
                httpRequest = new HttpGet(uri);
            } else if (method.equals(HTTPConstants.PATCH)) {
                httpRequest = new HttpPatch(uri);
            } else {
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

            } else if (method.equals(TRACE)) {
                httpRequest = new HttpTrace(uri);
            } else if (method.equals(OPTIONS)) {
                httpRequest = new HttpOptions(uri);
            } else if (method.equals(DELETE)) {
                httpRequest = new HttpDelete(uri);
            } else if (method.equals(GET)) {
                httpRequest = new HttpGet(uri);
            } else {
                throw new IllegalArgumentException("Unexpected method: "+method);
            }
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

  protected HttpUriRequest createHttpUriRequest(HttpMethod httpMethod, URI uri) {
    switch (httpMethod) {
      case GET:
        return new HttpGet(uri);
      case DELETE:
        return new HttpDelete(uri);
      case HEAD:
        return new HttpHead(uri);
      case OPTIONS:
        return new HttpOptions(uri);
      case POST:
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

  protected HttpUriRequest createHttpUriRequest(HttpMethod httpMethod, URI uri) {
    switch (httpMethod) {
      case GET:
        return new HttpGet(uri);
      case DELETE:
        return new HttpDelete(uri);
      case HEAD:
        return new HttpHead(uri);
      case OPTIONS:
        return new HttpOptions(uri);
      case POST:
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

        String r = configClient.replacePath("/setAllowCredentials/false")
            .accept("text/plain").post(null, String.class);
        assertEquals("ok", r);
       
        HttpClient httpclient = new DefaultHttpClient();
        HttpDelete httpdelete = new HttpDelete("http://localhost:" + PORT + "/untest/delete");
        httpdelete.addHeader("Origin", "http://localhost:" + PORT);

        HttpResponse response = httpclient.execute(httpdelete);
        assertEquals(200, response.getStatusLine().getStatusCode());
        assertAllowCredentials(response, false);
        assertOriginResponse(true, null, true, response);
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

        public Message invoke(Message msg) {
            // Delete an entry
            String id = (String)((Object[])msg.getBody())[0];

            // Send an HTTP DELETE
            HttpDelete deleteMethod = new HttpDelete(uri + "/" + id);
            if (authorizationHeader != null) {
                deleteMethod.setHeader("Authorization", authorizationHeader);
            }
            HttpResponse response = null;
            try {
                response = httpClient.execute(deleteMethod);
                int status = response.getStatusLine().getStatusCode();
View Full Code Here

Examples of org.apache.http.client.methods.HttpDelete

        super(URI.create(requestURI));
    }

    @Override
    protected HttpUriRequest createRequest(final URI requestURI) {
        return new HttpDelete(requestURI);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.