Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpVersion


        }

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            HttpVersion httpversion = request.getRequestLine().getHttpVersion();
            response.setStatusLine(httpversion, HttpStatus.SC_OK);
            response.addHeader(new Header("Set-Cookie", "name=wrong; Path=/test"));
            response.addHeader(new Header("Set-Cookie2", "name=right; Path=\"/test\"; Version=\"1\""));
            response.setBodyString("whatever");
            return true;
View Full Code Here


        final SimpleHttpServerConnection conn,
        final SimpleRequest request) throws IOException
    {

        RequestLine line = request.getRequestLine();
        HttpVersion ver = line.getHttpVersion();
        String method = line.getMethod();
        if (!"CONNECT".equalsIgnoreCase(method)) {
            return false;
        }
        Socket targetSocket = null;
View Full Code Here

        }

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            HttpVersion ver = request.getRequestLine().getHttpVersion();
            response.setStatusLine(ver, HttpStatus.SC_OK);
            response.addHeader(new Header("Connection", "close"));
            response.addHeader(new Header("Set-Cookie",
                "custno = 12345; comment=test; version=1," +
                " name=John; version=1; max-age=600; secure; domain=.apache.org"));
View Full Code Here

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            RequestLine requestLine = request.getRequestLine();
            HttpVersion ver = requestLine.getHttpVersion();
            Header auth = request.getFirstHeader("Authorization");
            if (auth == null) {
                response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
                response.addHeader(new Header("WWW-Authenticate",
                        "Digest realm=\"realm1\", nonce=\"ABC123\""));
View Full Code Here

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            RequestLine requestLine = request.getRequestLine();
            HttpVersion ver = requestLine.getHttpVersion();
            Header auth = request.getFirstHeader("Authorization");
            if (auth == null) {
                response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
                response.addHeader(new Header("WWW-Authenticate", "NTLM"));
                response.setBodyString("Authorization required");
View Full Code Here

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            RequestLine requestLine = request.getRequestLine();
            HttpVersion ver = requestLine.getHttpVersion();
            Header auth = request.getFirstHeader("Authorization");
            if (auth == null) {
                response.setStatusLine(ver, HttpStatus.SC_BAD_REQUEST);
                response.setBodyString("Authorization header missing");
                return true;
View Full Code Here

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            RequestLine requestLine = request.getRequestLine();
            HttpVersion ver = requestLine.getHttpVersion();
            Header auth = request.getFirstHeader("Authorization");
            if (auth == null) {
                response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
                response.addHeader(new Header("WWW-Authenticate", "NTLM"));
                response.setBodyString("Authorization required");
View Full Code Here

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            RequestLine requestLine = request.getRequestLine();
            HttpVersion ver = requestLine.getHttpVersion();
            Header auth = request.getFirstHeader("Authorization");
            if (auth == null) {
                response.setStatusLine(ver, HttpStatus.SC_BAD_REQUEST);
                response.setBodyString("Authorization header missing");
                return true;
View Full Code Here

        final SimpleHttpServerConnection conn,
        final SimpleRequest request) throws IOException
    {

        RequestLine line = request.getRequestLine();
        HttpVersion ver = line.getHttpVersion();
        String method = line.getMethod();
        if (!"CONNECT".equalsIgnoreCase(method)) {
            return false;
        }
        Socket targetSocket = null;
View Full Code Here

        }

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            HttpVersion httpversion = request.getRequestLine().getHttpVersion();
            response.setStatusLine(httpversion, HttpStatus.SC_OK);
            response.addHeader(new Header("Set-Cookie", "name1=value1; path=/test"));
            response.setBodyString("whatever");
            return true;
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.HttpVersion

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.