Package org.apache.http.client.methods

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


    public HttpResponse delete(String bucket, String key, RequestMeta meta) {
        if (meta == null) {
            meta = new RequestMeta();
        }
        String url = ClientUtils.makeURI(config, bucket, key);
        HttpDelete delete = new HttpDelete(url);
        return executeMethod(bucket, key, delete, meta);
    }
View Full Code Here

    public HttpResponse delete(String bucket, String key, RequestMeta meta) {
        if (meta == null) {
            meta = new RequestMeta();
        }
        String url = ClientUtils.makeURI(config, bucket, key);
        HttpDelete delete = new HttpDelete(url);
        return executeMethod(bucket, key, delete, meta);
    }
View Full Code Here

        } else if (strMethod.equals("POST")) {
            request = new HttpPost(uri);
        } else if (strMethod.equals("PUT")) {
            request = new HttpPut(uri);
        } else if (strMethod.equals("DELETE")) {
            request = new HttpDelete(uri);
        } else if (strMethod.equals("HEAD")) {
            request = new HttpHead(uri);
        } else if (strMethod.equals("OPTIONS")) {
            request = new HttpOptions(uri);
        } else {
View Full Code Here

                putMethod.setEntity(entity);
            }
        } else if (request.getHttpMethod() == HttpMethodName.GET) {
            httpRequest = new HttpGet(uri);
        } else if (request.getHttpMethod() == HttpMethodName.DELETE) {
            httpRequest = new HttpDelete(uri);
        } else if (request.getHttpMethod() == HttpMethodName.HEAD) {
            httpRequest = new HttpHead(uri);
        } else {
            throw new AmazonClientException("Unknown HTTP method name: " + request.getHttpMethod());
        }
View Full Code Here

     * @throws org.apache.axis2.AxisFault - Thrown in case an exception occurs
     */
    protected void sendViaDelete(MessageContext msgContext, URL url, String soapActionString)
            throws AxisFault {

        HttpDelete deleteMethod = new HttpDelete();
        AbstractHttpClient httpClient = getHttpClient(msgContext);
        populateCommonProperties(msgContext, url, deleteMethod, httpClient, soapActionString);

        /*
         * main execution takes place..
View Full Code Here

        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

        Assert.assertEquals("http://stanbol.apache.org/downloads/", downloadValues.iterator().next().get(0));
    }
   
    private void testEntityDelete() throws IOException {
        String stanbolProjectUri = "http://stanbol.apache.org";
        Request request = builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", stanbolProjectUri)));
        RequestExecutor re = executor.execute(request);
        re.assertStatus(200);
    }
View Full Code Here

            builder.buildGetRequest("/entityhub/entity","id",id)
            .withHeader("Accept", "application/json"));
        re.assertStatus(404);
    }
    private void testEntityDeleteAll() throws IOException {
        Request request = builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", "*")));
        RequestExecutor re = executor.execute(request);
        re.assertStatus(200);
    }
View Full Code Here

            "/entityhub/lookup", "id",uri));
        re.assertStatus(200);
        assertEntity(re.getContent(), ehUri, "entityhub");
       
        //finally delete the entity
        re = executor.execute(builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", ehUri))));
        re.assertStatus(200);

    }
View Full Code Here

TOP

Related Classes of org.apache.http.client.methods.HttpDelete

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.