Package org.apache.abdera.protocol.client

Examples of org.apache.abdera.protocol.client.RequestOptions


  public void testUpToDateGet() throws Exception {
    // 3) Conditional GET example (get with If-Mod. entry is up to date)
    // User client GET request
    //       GET /edit/first-post.atom HTTP/1.1
    // >      If-Modified-Since: Sat, 29 Oct 2025 19:43:31 GMT
    RequestOptions opts = new RequestOptions();
    final String contentType = "application/atom+xml; type=entry";
    opts.setContentType(contentType);
    opts.setHeader( "If-Modified-Since", "Sat, 29 Oct 2025 19:43:31 GMT"); // "EEE, dd MMM yyyy HH:mm:ss Z // RFC 822 Date
    opts.setHeader( "Pragma", "no-cache"); // turn off client caching
   
    IRI colUri = new IRI(providerURI).resolve("customer");
    // res = client.post(colUri.toString() + "?test=foo", entry, opts);
    String id = eTag.substring( 1, eTag.length()-1);
    // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
View Full Code Here


  public void testOutOfDateGet() throws Exception {
    // 4) Conditional GET example (get with If-Mod. entry is not to date)
    // User client GET request
    //       GET /edit/first-post.atom HTTP/1.1
    // >      If-Modified-Since: Sat, 29 Oct 1844 19:43:31 GMT
    RequestOptions opts = new RequestOptions();
    final String contentType = "application/atom+xml; type=entry";
    opts.setContentType(contentType);
    opts.setHeader( "If-Modified-Since", "Sat, 29 Oct 1844 19:43:31 GMT"); // "EEE, dd MMM yyyy HH:mm:ss Z // RFC 822 Date
    opts.setHeader( "Pragma", "no-cache"); // turn off client caching
   
    IRI colUri = new IRI(providerURI).resolve("customer");
    // res = client.post(colUri.toString() + "?test=foo", entry, opts);
    String id = eTag.substring( 1, eTag.length()-1);
    // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
View Full Code Here

  public void testUpToDateUnModGet() throws Exception {
    // 3) Conditional GET example (get with If-Unmod. entry is not modified (< predicate date).
    // User client GET request
    //       GET /edit/first-post.atom HTTP/1.1
    // >      If-Unmodified-Since: Sat, 29 Oct 2025 19:43:31 GMT
    RequestOptions opts = new RequestOptions();
    final String contentType = "application/atom+xml; type=entry";
    opts.setContentType(contentType);
    opts.setHeader( "If-Unmodified-Since", "Sat, 29 Oct 2050 19:43:31 GMT" );
    opts.setHeader( "Pragma", "no-cache"); // turn off client caching
   
    IRI colUri = new IRI(providerURI).resolve("customer");
    // res = client.post(colUri.toString() + "?test=foo", entry, opts);
    String id = eTag.substring( 1, eTag.length()-1);
    // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
View Full Code Here

    // 4) Conditional GET example (get with If-Unmod. entry is modified (> predicate date)
    // User client GET request
    //       GET /edit/first-post.atom HTTP/1.1
    //        Host: example.org
    // >      If-Unmodified-Since: Sat, 29 Oct 1844 19:43:31 GMT
    RequestOptions opts = new RequestOptions();
    final String contentType = "application/atom+xml; type=entry";
    opts.setContentType(contentType);
    opts.setHeader( "If-Unmodified-Since", "Sat, 29 Oct 1844 19:43:31 GMT" );
    opts.setHeader( "Pragma", "no-cache"); // turn off client caching
   
    IRI colUri = new IRI(providerURI).resolve("customer");
    // res = client.post(colUri.toString() + "?test=foo", entry, opts);
    String id = eTag.substring( 1, eTag.length()-1);
    // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
View Full Code Here

        Content content = abdera.getFactory().newContent();
        content.setContentType(Content.Type.TEXT);
        content.setValue(customerName);
        entry.setContentElement(content);

        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml";
        opts.setContentType(contentType);
        // AtomTestCaseUtils.printRequestHeaders( "Post request headers", "   ", opts );
        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        ClientResponse res = client.post(colUri.toString(), entry, opts);
View Full Code Here

        Content content = abdera.getFactory().newContent();
        content.setContentType(Content.Type.TEXT);
        content.setValue(customerName);
        entry.setContentElement(content);

        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml";
        opts.setContentType(contentType);
        opts.setHeader( "If-None-Match", eTag);

        // AtomTestCaseUtils.printRequestHeaders( "Put request headers", "   ", opts );
        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        id = eTag.substring( 1, eTag.length()-1);
View Full Code Here

        // 4) Conditional GET example (get with etag. etag not in cache)
        // User client GET request
        //       GET /edit/first-post.atom HTTP/1.1
        // >      If-None-Match: "e180ee84f0671b1"

        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml";
        opts.setContentType(contentType);
        opts.setHeader( "If-None-Match", "123456");
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
View Full Code Here

        // 3) Conditional GET example (get with etag. etag match)
        // User client GET request
        //       GET /edit/first-post.atom HTTP/1.1
        // >      If-None-Match: "e180ee84f0671b1"

        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml";
        opts.setContentType(contentType);
        opts.setHeader( "If-None-Match", eTag);
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
View Full Code Here

    public void testUpToDateGet() throws Exception {
        // 3) Conditional GET example (get with If-Mod. entry is up to date)
        // User client GET request
        //       GET /edit/first-post.atom HTTP/1.1
        // >      If-Modified-Since: Sat, 29 Oct 2025 19:43:31 GMT
        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml";
        opts.setContentType(contentType);
        opts.setHeader( "If-Modified-Since", "Sat, 29 Oct 2025 19:43:31 GMT"); // "EEE, dd MMM yyyy HH:mm:ss Z // RFC 822 Date
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
View Full Code Here

    public void testOutOfDateGet() throws Exception {
        // 4) Conditional GET example (get with If-Mod. entry is not to date)
        // User client GET request
        //       GET /edit/first-post.atom HTTP/1.1
        // >      If-Modified-Since: Sat, 29 Oct 1844 19:43:31 GMT
        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml";
        opts.setContentType(contentType);
        opts.setHeader( "If-Modified-Since", "Sat, 29 Oct 1844 19:43:31 GMT"); // "EEE, dd MMM yyyy HH:mm:ss Z // RFC 822 Date
        opts.setHeader( "Pragma", "no-cache"); // turn off client caching

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        String id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.client.RequestOptions

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.