Package org.apache.abdera.protocol.client

Examples of org.apache.abdera.protocol.client.AbderaClient.post()


        } finally {
            response.release();
        }

        // post a new entry
        response = abderaClient.post(col_uri, entry, options);

        String self_uri;

        try {
            assertEquals(201, response.getStatus());
View Full Code Here


        options = abderaClient.getDefaultRequestOptions();
        options.setContentType("text/plain");
        options.setHeader("Connection", "close");
        options.setUseExpectContinue(false);

        response = abderaClient.post(col_uri, new ByteArrayInputStream("test".getBytes()), options);

        try {
            assertEquals(201, response.getStatus());
            assertNotNull(response.getLocation());
            assertNotNull(response.getContentLocation());
View Full Code Here

        customerEl.setAttributeValue(new QName("name"), "Dan Diephouse");
        entry.setContent(customerEl);

        RequestOptions opts = new RequestOptions();
        opts.setContentType("application/atom+xml;type=entry");
        res = client.post(colUri.toString() + "?test=foo", entry, opts);
        assertEquals(201, res.getStatus());

        // prettyPrint(abdera, res.getDocument());

        IRI location = res.getLocation();
View Full Code Here

        entry.setId("tag:apache.org,2008:234534344");
        entry.setSummary("multipart test");
        entry.setContent(new IRI("cid:234234@example.com"), contentType);

        ClientResponse res =
            client.post("http://localhost:9002/media", entry, this.getClass().getResourceAsStream("info.png"));
        assertEquals(status, res.getStatus());
    }
}
View Full Code Here

        RequestOptions options = abderaClient.getDefaultRequestOptions();
        options.setUseChunked(false);

        // Post the entry
        Response response =
            abderaClient.post("http://beta.blogger.com/feeds/7352231422284704069/posts/full", entry, options);

        // Check the response.
        if (response.getStatus() == 201)
            System.out.println("Success!");
        else
View Full Code Here

        Service service = service_doc.getRoot();
        Collection collection = service.getWorkspaces().get(0).getCollections().get(0);
        String uri = collection.getHref().toString();

        // Post the entry to the collection
        Response response = abderaClient.post(uri, entry);

        // Check the result
        if (response.getStatus() == 201)
            System.out.println("Success!");
        else
View Full Code Here

        // current Roller APP implementation still currently requires it.
        RequestOptions options = abderaClient.getDefaultRequestOptions();
        options.setHeader("Title", "mypodcast.mp3");

        // Post the entry
        Response response = abderaClient.post(uri, re, options);

        // Check the response
        if (response.getStatus() == 201)
            System.out.println("Success!");
        else
View Full Code Here

        RequestOptions options = abderaClient.getDefaultRequestOptions();
        options.setUseChunked(false);

        // Post the entry
        Response response = abderaClient.post(uri, entry, options);

        // Google Calendar might return a 302 response with a new POST URI.
        // If it does, get the new URI and post again
        if (response.getStatus() == 302) {
            uri = response.getLocation().toString();
View Full Code Here

        // Google Calendar might return a 302 response with a new POST URI.
        // If it does, get the new URI and post again
        if (response.getStatus() == 302) {
            uri = response.getLocation().toString();
            response = abderaClient.post(uri, entry, options);
        }

        // Check the response
        if (response.getStatus() == 201)
            System.out.println("Success!");
View Full Code Here

        customerEl.setAttributeValue(new QName("name"), "Dan Diephouse");
        entry.setContent(customerEl);

        RequestOptions opts = new RequestOptions();
        opts.setContentType("application/atom+xml;type=entry");
        ClientResponse res = client.post(colUri.toString(), entry, opts);
        assertEquals(201, res.getStatus());

        IRI location = res.getLocation();
        assertEquals(basePath + "/customers/1001-Dan_Diephouse", location.toString());
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.