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", "name1=value1; Path=\"/test\"; Version=\"1\""));
            response.addHeader(new Header("Set-Cookie2", "name2=value2; Path=\"/test\"; Version=\"1\""));
            response.setBodyString("whatever");
            return true;
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-Cookie2", "name2=value2; Path=\"/test\"; Version=\"2\""));
            response.setBodyString("whatever");
            return true;
        }
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", "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

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            String uri = request.getRequestLine().getUri()
            HttpVersion httpversion = request.getRequestLine().getHttpVersion();
           
            if ("/miss/".equals(uri)) {
                response.setStatusLine(httpversion, HttpStatus.SC_MOVED_TEMPORARILY);
                response.addHeader(new Header("Location", "/hit/"));
                response.setBodyString("Missed!");
View Full Code Here

                            configurationContext.getAxisConfiguration().getTransportIn(
                                    new QName(Constants.TRANSPORT_HTTP)),
                            transportOut);
            msgContext.setServerSide(true);

            HttpVersion ver = request.getRequestLine().getHttpVersion();
            if (ver == null) {
                throw new AxisFault("HTTP version can not be Null");
            }
            String httpVersion = null;
            if (HttpVersion.HTTP_1_0.equals(ver)) {
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

    protected void doSetUp() throws Exception
    {
        super.doSetUp();

        _resp = new HttpResponse();
        _resp.setStatusLine(new HttpVersion(1, 1), 200);
        _resp.setHeader(new Header(HttpConstants.HEADER_CONTENT_TYPE, HttpConstants.DEFAULT_CONTENT_TYPE));
        _resp.setBody(new DefaultMuleMessage(_body, muleContext));
    }
View Full Code Here

    public List<String> getParameterValues(String s) {
        return null;
    }

    public HTTP_VERSION getVersion() {
        HttpVersion httpVersion = (HttpVersion) postMethod.getParams().getParameter("http.protocol.version");

        if (httpVersion == HttpVersion.HTTP_1_1) {
            return HTTP_VERSION.HTTP1_1;
        }
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

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.