Package org.apache.http.impl

Examples of org.apache.http.impl.DefaultHttpRequestFactory


    }
   
    public void testParsingIncompleteHeader() throws Exception {
        HttpParams params = new BasicHttpParams();
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory, params);
       
        ReadableByteChannel channel = newChannel("GET /whatever HTTP/1.0\r\nHeader: whatever");
        requestParser.fillBuffer(channel);
        requestParser.fillBuffer(channel);
View Full Code Here


    }
   
    public void testParsingInvalidRequestLine() throws Exception {
        HttpParams params = new BasicHttpParams();
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory, params);
       
        ReadableByteChannel channel = newChannel("GET garbage\r\n");
        requestParser.fillBuffer(channel);
        try {
View Full Code Here

    }
   
    public void testResetParser() throws Exception {
        HttpParams params = new BasicHttpParams();
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory, params);
       
        ReadableByteChannel channel = newChannel("GET /whatever HTTP/1.0\r\nHeader: one\r\n\r\n");
        requestParser.fillBuffer(channel);
        HttpRequest request = (HttpRequest) requestParser.parse();
View Full Code Here

    }

    public void testLineLimitForStatus() throws Exception {
        HttpParams params = new BasicHttpParams();
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();

        params.setIntParameter(HttpConnectionParams.MAX_LINE_LENGTH, 0);
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory, params);
        requestParser.fillBuffer(newChannel("GET /whatever HTTP/1.0\r\nHeader: one\r\n\r\n"));
        requestParser.parse();
View Full Code Here

    }

    public void testLineLimitForHeader() throws Exception {
        HttpParams params = new BasicHttpParams();
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();

        params.setIntParameter(HttpConnectionParams.MAX_LINE_LENGTH, 0);
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory, params);
        requestParser.fillBuffer(newChannel("GET /whatever HTTP/1.0\r\nHeader: one\r\n\r\n"));
        requestParser.parse();
View Full Code Here

    }

    public void testLineLimitForFoldedHeader() throws Exception {
        HttpParams params = new BasicHttpParams();
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();

        params.setIntParameter(HttpConnectionParams.MAX_HEADER_COUNT, 2);
        params.setIntParameter(HttpConnectionParams.MAX_LINE_LENGTH, 15);       
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory, params);
        try {
View Full Code Here

    }

    public void testMaxHeaderCount() throws Exception {
        HttpParams params = new BasicHttpParams();
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();

        params.setIntParameter(HttpConnectionParams.MAX_HEADER_COUNT, 2);
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory, params);
        requestParser.fillBuffer(newChannel("GET /whatever HTTP/1.0\r\nHeader: one\r\nHeader: two\r\n\r\n"));
        requestParser.parse();
View Full Code Here

                this.sslcontext,
                this.sslHandler);
       
        DefaultNHttpServerConnection conn = new DefaultNHttpServerConnection(
                sslSession,
                new DefaultHttpRequestFactory(),
                this.allocator,
                this.params);
       
        session.setAttribute(NHTTP_CONN, conn);
        session.setAttribute(SSL_SESSION, sslSession);
View Full Code Here

    }
   
    public void connected(final IOSession session) {
        DefaultNHttpServerConnection conn = new DefaultNHttpServerConnection(
                session,
                new DefaultHttpRequestFactory(),
                this.allocator,
                this.params);
        session.setAttribute(NHTTP_CONN, conn);
        this.handler.connected(conn);
    }
View Full Code Here

                this.sslcontext,
                this.sslHandler);
       
        DefaultNHttpServerConnection conn = new DefaultNHttpServerConnection(
                new LoggingIOSession(sslSession),
                new DefaultHttpRequestFactory(),
                this.params);
       
        session.setAttribute(NHTTP_CONN, conn);
        session.setAttribute(SSL_SESSION, sslSession);
View Full Code Here

TOP

Related Classes of org.apache.http.impl.DefaultHttpRequestFactory

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.