Package io.netty.handler.codec.http

Examples of io.netty.handler.codec.http.DefaultCookie


            String value = evt.getParameter("value");
            if (key == null || value == null) {
                setState(new RespondWith(Err.badRequest("Missing params")));
                return;
            }
            DefaultCookie ck = new DefaultCookie(key, value);
            ck.setMaxAge(500);
            ck.setPath(evt.getPath().toStringWithLeadingSlash());
            add(Headers.SET_COOKIE, ck);
            ok(value);
        }
View Full Code Here


        //connection will not close but needed
        // headers.set("Connection","keep-alive");

        headers.set(
                HttpHeaderNames.COOKIE, ClientCookieEncoder.encode(
                        new DefaultCookie("my-cookie", "foo"),
                        new DefaultCookie("another-cookie", "bar"))
        );

        // send request
        List<Entry<String, String>> entries = headers.entriesConverted();
        channel.writeAndFlush(request);
View Full Code Here

            // Set some example cookies.
            request.headers().set(
                    HttpHeaderNames.COOKIE,
                    ClientCookieEncoder.encode(
                            new DefaultCookie("my-cookie", "foo"),
                            new DefaultCookie("another-cookie", "bar")));

            // Send the HTTP request.
            ch.writeAndFlush(request);

            // Wait for the server to close the connection.
View Full Code Here

TOP

Related Classes of io.netty.handler.codec.http.DefaultCookie

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.