Package org.eclipse.jetty.client.api

Examples of org.eclipse.jetty.client.api.Request.header()


        Request connect1 = newBayeuxRequest("[{" +
                "\"channel\": \"/meta/connect\"," +
                "\"clientId\": \"" + clientId + "\"," +
                "\"connectionType\": \"long-polling\"" +
                "}]");
        connect1.header(HttpHeader.HOST.asString(), "http://127.0.0.1:" + port);
        connect1.header("Origin", "http://localhost:" + port);
        response = connect1.send();
        Assert.assertEquals(200, response.getStatus());

        long begin = System.currentTimeMillis();
View Full Code Here


                "\"channel\": \"/meta/connect\"," +
                "\"clientId\": \"" + clientId + "\"," +
                "\"connectionType\": \"long-polling\"" +
                "}]");
        connect1.header(HttpHeader.HOST.asString(), "http://127.0.0.1:" + port);
        connect1.header("Origin", "http://localhost:" + port);
        response = connect1.send();
        Assert.assertEquals(200, response.getStatus());

        long begin = System.currentTimeMillis();
        Request connect2 = newBayeuxRequest("[{" +
View Full Code Here

        Request connect2 = newBayeuxRequest("[{" +
                "\"channel\": \"/meta/connect\"," +
                "\"clientId\": \"" + clientId + "\"," +
                "\"connectionType\": \"long-polling\"" +
                "}]");
        connect2.header(HttpHeader.HOST.asString(), "http://127.0.0.1:" + port);
        connect2.header("Origin", "http://localhost:" + port);
        response = connect2.timeout(timeout * 2, TimeUnit.SECONDS).send();
        Assert.assertEquals(200, response.getStatus());
        long elapsed = System.currentTimeMillis() - begin;
        Assert.assertTrue("" + elapsed, elapsed >= (timeout - timeout / 10));
View Full Code Here

                "\"channel\": \"/meta/connect\"," +
                "\"clientId\": \"" + clientId + "\"," +
                "\"connectionType\": \"long-polling\"" +
                "}]");
        connect2.header(HttpHeader.HOST.asString(), "http://127.0.0.1:" + port);
        connect2.header("Origin", "http://localhost:" + port);
        response = connect2.timeout(timeout * 2, TimeUnit.SECONDS).send();
        Assert.assertEquals(200, response.getStatus());
        long elapsed = System.currentTimeMillis() - begin;
        Assert.assertTrue("" + elapsed, elapsed >= (timeout - timeout / 10));
    }
View Full Code Here

        Map<String, Collection<String>> headers = request.getHeaders();
        for (Map.Entry<String, Collection<String>> stringCollectionEntry : headers.entrySet()) {
            String key = stringCollectionEntry.getKey();
            Collection<String> stringCollection = stringCollectionEntry.getValue();
            String value = joiner.join(stringCollection);
            httpRequest = httpRequest.header(key, value);
        }

        for (Map.Entry<String, Collection<String>> stringCollectionEntry : request.getQueryParams().entrySet()) {
            String key = stringCollectionEntry.getKey();
            Collection<String> stringCollection = stringCollectionEntry.getValue();
View Full Code Here

            // Remove authorization headers
            if (HttpHeader.AUTHORIZATION == header.getHeader() ||
                    HttpHeader.PROXY_AUTHORIZATION == header.getHeader())
                continue;

            newRequest.header(header.getName(), header.getValue());
        }
        return newRequest;
    }

    protected HttpRequest newHttpRequest(HttpConversation conversation, URI uri)
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.