Package com.sun.jersey.api.client

Examples of com.sun.jersey.api.client.WebResource.head()


    public void testCreateCancelPurge() throws Exception {
        Client c = new Client();
        String url = "http://localhost:" + getJettyPort() + "/shop";

        WebResource wr = c.resource(url);
        ClientResponse response = wr.head();
        Map<String, Link> shoppingLinks = processLinkHeaders(response);

        Link customers = shoppingLinks.get("customers");
        System.out.println("** Create a customer through this URL: " + customers.getHref());

View Full Code Here


        response = wr.get(ClientResponse.class);
        System.out.println(response.getEntity(String.class));
        Map<String, Link> ordersLinks = processLinkHeaders(response);

        wr = c.resource(createdOrderUrl);
        response = wr.head();
        Map<String, Link> orderLinks = processLinkHeaders(response);

        Link cancel = orderLinks.get("cancel");
        if (cancel != null) {
            System.out.println("** Canceling the order at URL: " + cancel.getHref());
View Full Code Here

    public void testPopulateDB() throws Exception {
        Client c = new Client();
        String url = "http://localhost:" + getJettyPort() + "/shop";
        WebResource wr = c.resource(url);

        ClientResponse response = wr.head();
        Map<String, Link> shoppingLinks = processLinkHeaders(response);

        System.out.println("** Populate Products");
        wr = c.resource(shoppingLinks.get("products").getHref());

View Full Code Here

    public void testCreateOrder() throws Exception {
        Client c = new Client();

        String url = "http://localhost:" + getJettyPort() + "/shop";
        WebResource wr = c.resource(url);
        ClientResponse response = wr.head();
        Map<String, Link> shoppingLinks = processLinkHeaders(response);

        System.out.println("** Buy an iPhone for Bill Burke");
        System.out.println();
        System.out.println("** First see if Bill Burke exists as a customer");
View Full Code Here

        String url = "http://localhost:9095/shop";

        Client c = new Client();
        WebResource wr = c.resource("http://localhost:8080/ex11_1-war/shop");

        ClientResponse response = wr.head();
        Map<String, Link> shoppingLinks = processLinkHeaders(response);

        System.out.println("** Populate Products");
        wr = c.resource(shoppingLinks.get("products").getHref());

View Full Code Here

    public void testCreateOrder() throws Exception {
        String url = "http://localhost:9095/shop";

        Client c = new Client();
        WebResource wr = c.resource("http://localhost:8080/ex11_1-war/shop");
        ClientResponse response = wr.head();
        Map<String, Link> shoppingLinks = processLinkHeaders(response);

        System.out.println("** Buy an iPhone for Bill Burke");
        System.out.println();
        System.out.println("** First see if Bill Burke exists as a customer");
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.