Package org.jboss.netty.handler.codec.http

Examples of org.jboss.netty.handler.codec.http.HttpRequest.addHeader()


                  }
               }
            }

            HttpRequest httpRequest = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, url);
            httpRequest.addHeader(HttpHeaders.Names.HOST, NettyConnector.this.host);
            if (cookie != null)
            {
               httpRequest.addHeader(HttpHeaders.Names.COOKIE, cookie);
            }
            ChannelBuffer buf = (ChannelBuffer)e.getMessage();
View Full Code Here


            HttpRequest httpRequest = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, url);
            httpRequest.addHeader(HttpHeaders.Names.HOST, NettyConnector.this.host);
            if (cookie != null)
            {
               httpRequest.addHeader(HttpHeaders.Names.COOKIE, cookie);
            }
            ChannelBuffer buf = (ChannelBuffer)e.getMessage();
            httpRequest.setContent(buf);
            httpRequest.addHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buf.writerIndex()));
            Channels.write(ctx, e.getFuture(), httpRequest, e.getRemoteAddress());
View Full Code Here

            {
               httpRequest.addHeader(HttpHeaders.Names.COOKIE, cookie);
            }
            ChannelBuffer buf = (ChannelBuffer)e.getMessage();
            httpRequest.setContent(buf);
            httpRequest.addHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buf.writerIndex()));
            Channels.write(ctx, e.getFuture(), httpRequest, e.getRemoteAddress());
            lastSendTime = System.currentTimeMillis();
         }
         else
         {
View Full Code Here

            }

            if (!waitingGet && System.currentTimeMillis() > lastSendTime + httpMaxClientIdleTime)
            {
               HttpRequest httpRequest = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, url);
               httpRequest.addHeader(HttpHeaders.Names.HOST, NettyConnector.this.host);
               waitingGet = true;
               channel.write(httpRequest);
            }
         }
View Full Code Here

                String headerValue = tc.convertTo(String.class, it.next());

                if (headerValue != null && headerFilterStrategy != null
                        && !headerFilterStrategy.applyFilterToCamelHeaders(key, headerValue, message.getExchange())) {
                    LOG.trace("HTTP-Header: {}={}", key, headerValue);
                    request.addHeader(key, headerValue);
                }
            }
        }

        Object body = message.getBody();
View Full Code Here

    encoderDecoder.encode(baos, scmp);
    url = new URL(Constants.HTTP, host, port, scmp.getHttpUrlFileQualifier());
    HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, this.url.getPath());
    byte[] buffer = baos.toByteArray();
    // Http header fields
    request.addHeader(HttpHeaders.Names.USER_AGENT, System.getProperty("java.runtime.version"));
    request.addHeader(HttpHeaders.Names.HOST, host);
    request.addHeader(HttpHeaders.Names.ACCEPT, Constants.HTTP_ACCEPT_PARAMS);
    request.addHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
    request.addHeader(HttpHeaders.Names.CONTENT_TYPE, scmp.getBodyType().getMimeType());
    request.addHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buffer.length));
View Full Code Here

    url = new URL(Constants.HTTP, host, port, scmp.getHttpUrlFileQualifier());
    HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, this.url.getPath());
    byte[] buffer = baos.toByteArray();
    // Http header fields
    request.addHeader(HttpHeaders.Names.USER_AGENT, System.getProperty("java.runtime.version"));
    request.addHeader(HttpHeaders.Names.HOST, host);
    request.addHeader(HttpHeaders.Names.ACCEPT, Constants.HTTP_ACCEPT_PARAMS);
    request.addHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
    request.addHeader(HttpHeaders.Names.CONTENT_TYPE, scmp.getBodyType().getMimeType());
    request.addHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buffer.length));
    request.addHeader(HttpHeaders.Names.CACHE_CONTROL, HttpHeaders.Values.NO_CACHE);
View Full Code Here

    HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, this.url.getPath());
    byte[] buffer = baos.toByteArray();
    // Http header fields
    request.addHeader(HttpHeaders.Names.USER_AGENT, System.getProperty("java.runtime.version"));
    request.addHeader(HttpHeaders.Names.HOST, host);
    request.addHeader(HttpHeaders.Names.ACCEPT, Constants.HTTP_ACCEPT_PARAMS);
    request.addHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
    request.addHeader(HttpHeaders.Names.CONTENT_TYPE, scmp.getBodyType().getMimeType());
    request.addHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buffer.length));
    request.addHeader(HttpHeaders.Names.CACHE_CONTROL, HttpHeaders.Values.NO_CACHE);
    request.addHeader(HttpHeaders.Names.PRAGMA, HttpHeaders.Values.NO_CACHE);
View Full Code Here

    byte[] buffer = baos.toByteArray();
    // Http header fields
    request.addHeader(HttpHeaders.Names.USER_AGENT, System.getProperty("java.runtime.version"));
    request.addHeader(HttpHeaders.Names.HOST, host);
    request.addHeader(HttpHeaders.Names.ACCEPT, Constants.HTTP_ACCEPT_PARAMS);
    request.addHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
    request.addHeader(HttpHeaders.Names.CONTENT_TYPE, scmp.getBodyType().getMimeType());
    request.addHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buffer.length));
    request.addHeader(HttpHeaders.Names.CACHE_CONTROL, HttpHeaders.Values.NO_CACHE);
    request.addHeader(HttpHeaders.Names.PRAGMA, HttpHeaders.Values.NO_CACHE);
View Full Code Here

    // Http header fields
    request.addHeader(HttpHeaders.Names.USER_AGENT, System.getProperty("java.runtime.version"));
    request.addHeader(HttpHeaders.Names.HOST, host);
    request.addHeader(HttpHeaders.Names.ACCEPT, Constants.HTTP_ACCEPT_PARAMS);
    request.addHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
    request.addHeader(HttpHeaders.Names.CONTENT_TYPE, scmp.getBodyType().getMimeType());
    request.addHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(buffer.length));
    request.addHeader(HttpHeaders.Names.CACHE_CONTROL, HttpHeaders.Values.NO_CACHE);
    request.addHeader(HttpHeaders.Names.PRAGMA, HttpHeaders.Values.NO_CACHE);

    NettyHttpRequesterResponseHandler handler = channel.getPipeline().get(NettyHttpRequesterResponseHandler.class);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.