Package org.apache.abdera.protocol.client.util

Examples of org.apache.abdera.protocol.client.util.BaseRequestEntity


    private static Scriptable post(Context cx, Object[] arguments, APPClientHostObject hostObject,
                                   Entry entry) throws CarbonException {

        performAuthentication(hostObject, (String) arguments[0]);
        Response response = hostObject.client.post((String) arguments[0],
                                                   new BaseRequestEntity(entry, false),
                                                   hostObject.options);

        // Check the response.
        if (response.getStatus() != 201) {
            throw new CarbonException("Posting Failed." + response.getStatusText());
View Full Code Here


    IRI colUri = new IRI(providerURI).resolve("customer");
    // res = client.post(colUri.toString() + "?test=foo", entry, opts);
      id = eTag.substring( 1, eTag.length()-1);
    // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
    // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
    ClientResponse res = client.put(colUri.toString() + "/" + id, new BaseRequestEntity( entry ), opts);
    // Expected Atom server response (item was edited by another user)
    // >      HTTP/1.1 412 Precondition Failed
    //       Date: Sat, 24 Feb 2007 16:34:11 GMT

      // If-Match Assert response status code is 412. Precondition failed.
View Full Code Here

        IRI colUri = new IRI(providerURI).resolve("customer");
        // res = client.post(colUri.toString() + "?test=foo", entry, opts);
        id = eTag.substring( 1, eTag.length()-1);
        // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
        // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
        ClientResponse res = client.put(colUri.toString() + "/" + id, new BaseRequestEntity( entry ), opts);
        // Expected Atom server response (item was edited by another user)
        // >      HTTP/1.1 412 Precondition Failed
        //       Date: Sat, 24 Feb 2007 16:34:11 GMT

        // If-Match Assert response status code is 412. Precondition failed.
View Full Code Here

        Document d = (Document) base;
        if (options.getSlug() == null &&
            d.getSlug() != null)
          options.setSlug(d.getSlug());
      }
      return execute("POST", uri, new BaseRequestEntity(base, options.isUseChunked()), options);
  }
View Full Code Here

          options.setIfMatch(d.getEntityTag());
        else if (d.getLastModified() != null)
          options.setIfUnmodifiedSince(d.getLastModified());
      }
    }
    return execute("PUT", uri, new BaseRequestEntity(base, options.isUseChunked()), options);
  }
View Full Code Here

    Base base,
    RequestOptions options) {
      return execute(
        method,
        uri,
        new BaseRequestEntity(base),
        options);
  }
View Full Code Here

        if (base instanceof Document) {
            Document d = (Document)base;
            if (options.getSlug() == null && d.getSlug() != null)
                options.setSlug(d.getSlug());
        }
        return execute("POST", uri, new BaseRequestEntity(base, options.isUseChunked()), options);
    }
View Full Code Here

                    options.setIfMatch(d.getEntityTag());
                else if (d.getLastModified() != null)
                    options.setIfUnmodifiedSince(d.getLastModified());
            }
        }
        return execute("PUT", uri, new BaseRequestEntity(base, options.isUseChunked()), options);
    }
View Full Code Here

     * @param uri The request URI
     * @param base A FOM Document and Element providing the payload for the request
     * @param options The Request Options
     */
    public ClientResponse execute(String method, String uri, Base base, RequestOptions options) {
        return execute(method, uri, new BaseRequestEntity(base), options);
    }
View Full Code Here

    IRI colUri = new IRI(providerURI).resolve("customer");
    // res = client.post(colUri.toString() + "?test=foo", entry, opts);
      id = eTag.substring( 1, eTag.length()-1);
    // Warning. AbderaClient.put(String uri,Base base,RequestOptions options) caches on the client side.
    // ClientResponse res = client.put(colUri.toString() + id, entry, opts);
    ClientResponse res = client.put(colUri.toString() + "/" + id, new BaseRequestEntity( entry ), opts);
    // Expected Atom server response (item was edited by another user)
    // >      HTTP/1.1 412 Precondition Failed
    //       Date: Sat, 24 Feb 2007 16:34:11 GMT

      // If-Match Assert response status code is 412. Precondition failed.
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.client.util.BaseRequestEntity

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.