Package org.vertx.java.core.http

Examples of org.vertx.java.core.http.CaseInsensitiveMultiMap


                assertEquals("DELETE", request.method());
                request.response().end();
            }
        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("x-http-setMethod-override", "DELETE");

        new YokeTester(yoke).request("GET", "/upload", headers, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
View Full Code Here


            }
        });

        Buffer body = new Buffer("_method=delete");

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("content-type", "application/x-www-form-urlencoded");
        headers.add("content-length", Integer.toString(body.length()));

        new YokeTester(yoke).request("POST", "/upload", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
View Full Code Here

            }
        });

        Buffer body = new Buffer(json.encode());

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("content-type", "application/json");
        headers.add("content-length", Integer.toString(body.length()));

        new YokeTester(yoke).request("POST", "/upload", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
View Full Code Here

                request.response().end(request.accepts("text"));
            }
        });

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("accept", "text/plain; q=0.5, application/json, text/html; q=0.8, text/xml");
        // expected order is:
        // application/json
        // text/xml
        // text/html
        // text/plain
View Full Code Here

                testComplete();
            }
        });

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("x-forward-for", "123.456.123.456, 111.111.11.11");

        new YokeTester(yoke).request("GET", "/", headers, null);
    }
View Full Code Here

                testComplete();
            }
        });

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Accept-Language", "en-gb;q=0.8, en;q=0.7, da_DK;q=0.9");

        new YokeTester(yoke).request("GET", "/", headers, null);
    }
View Full Code Here

                testComplete();
            }
        });

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Accept-Language", "da, en-gb;q=0.8, en;q=0.7");

        new YokeTester(yoke).request("GET", "/", headers, null);
    }
View Full Code Here

                testComplete();
            }
        });

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Accept-Language", "en-gb");

        new YokeTester(yoke).request("GET", "/", headers, null);
    }
View Full Code Here

            public void handle(Response resp) {
                assertEquals(401, resp.getStatusCode());
                assertNotNull(resp.headers.get("www-authenticate"));

                // second time send the authorization header
                MultiMap headers = new CaseInsensitiveMultiMap();
                headers.add("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");

                yokeAssert.request("GET", "/", headers, new Handler<Response>() {
                    @Override
                    public void handle(Response resp) {
                        assertEquals(200, resp.getStatusCode());
View Full Code Here

            public void handle(Response resp) {
                assertEquals(401, resp.getStatusCode());
                assertNotNull(resp.headers.get("www-authenticate"));

                // second time send the authorization header
                MultiMap headers = new CaseInsensitiveMultiMap();
                headers.add("authorization", "Basic QWxhZGRpbjo=");

                yokeAssert.request("GET", "/", headers, new Handler<Response>() {
                    @Override
                    public void handle(Response resp) {
                        assertEquals(200, resp.getStatusCode());
View Full Code Here

TOP

Related Classes of org.vertx.java.core.http.CaseInsensitiveMultiMap

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.