Package org.apache.http.impl

Examples of org.apache.http.impl.DefaultHttpRequestFactory


     * a different implementation of the {@link HttpRequestFactory} interface.
     *
     * @return HTTP request factory.
     */
    protected HttpRequestFactory createHttpRequestFactory() {
        return new DefaultHttpRequestFactory();
    }
View Full Code Here


import org.apache.http.params.HttpParams;

public class LoggingServerConnectionFactory extends DefaultNHttpServerConnectionFactory {

    public LoggingServerConnectionFactory(final HttpParams params) {
        super(new DefaultHttpRequestFactory(), new HeapByteBufferAllocator(), params);
    }
View Full Code Here

public class LoggingSSLServerConnectionFactory extends SSLNHttpServerConnectionFactory {

    public LoggingSSLServerConnectionFactory(
            final SSLContext sslcontext,
            final HttpParams params) {
        super(sslcontext, null, new DefaultHttpRequestFactory(), new HeapByteBufferAllocator(), params);
    }
View Full Code Here

  @Override
    protected HttpRequestFactory createHttpRequestFactory() {
        if (websocket.isWebSocket()) {
          return new WebSocketRequestFactory();
        } else {
          return new DefaultHttpRequestFactory();
        }
    }
View Full Code Here

                this.sslcontext,
                this.sslHandler);

        LoggingNHttpServerConnection conn = new LoggingNHttpServerConnection(
                new LoggingIOSession(sslSession),
                new DefaultHttpRequestFactory(),
                new HeapByteBufferAllocator(),
                this.params);

        session.setAttribute(NHTTP_CONN, conn);
        session.setAttribute(SSL_SESSION, sslSession);
View Full Code Here

   
    public void connected(final IOSession session) {
        // Decorate I/O session with logging capabilities
        LoggingNHttpServerConnection conn = new LoggingNHttpServerConnection(
                new LoggingIOSession(session),
                new DefaultHttpRequestFactory(),
                new HeapByteBufferAllocator(),
                this.params);
        session.setAttribute(NHTTP_CONN, conn);
        this.handler.connected(conn);
    }
View Full Code Here

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

        return newChannel(s, "US-ASCII");
    }

    public void testSimpleParsing() throws Exception {
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory);
        requestParser.fillBuffer(newChannel("GET /whatever HTTP/1.1\r\nSome header: stuff\r\n\r\n"));
        HttpRequest request = (HttpRequest) requestParser.parse();
        assertNotNull(request);
        assertEquals("/whatever", request.getRequestLine().getUri());
View Full Code Here

        assertEquals(1, request.getAllHeaders().length);
    }

    public void testParsingChunkedMessages() throws Exception {
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory);

        requestParser.fillBuffer(newChannel("GET /whatev"));
        HttpRequest request = (HttpRequest) requestParser.parse();
        assertNull(request);
View Full Code Here

       
    }

    public void testParsingFoldedHeaders() throws Exception {
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
        HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory);

        requestParser.fillBuffer(newChannel("GET /whatev"));
        HttpRequest request = (HttpRequest) requestParser.parse();
        assertNull(request);
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.