Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpMethod.addRequestHeader()


        // propagate headers as HTTP headers
        for (String headerName : in.getHeaders().keySet()) {
            String headerValue = in.getHeader(headerName, String.class);
            if (strategy != null && !strategy.applyFilterToCamelHeaders(headerName, headerValue)) {
                method.addRequestHeader(headerName, headerValue);
            }
        }

        // lets store the result in the output message.
        try {
View Full Code Here


        HttpBinding binding = ((HttpEndpoint)getEndpoint()).getBinding();
        // propagate headers as HTTP headers
        for (String headerName : exchange.getIn().getHeaders().keySet()) {
            String headerValue = exchange.getIn().getHeader(headerName, String.class);
            if (binding.shouldHeaderBePropagated(headerName, headerValue)) {
                method.addRequestHeader(headerName, headerValue);
            }
        }

        int responseCode = httpClient.executeMethod(method);
View Full Code Here

        // propagate headers as HTTP headers
        for (String headerName : in.getHeaders().keySet()) {
            String headerValue = in.getHeader(headerName, String.class);
            if (strategy != null && !strategy.applyFilterToCamelHeaders(headerName, headerValue)) {
                method.addRequestHeader(headerName, headerValue);
            }
        }

        // lets store the result in the output message.
        try {
View Full Code Here

            // invalid uri? begone.
            request.handleError(server);
            return;
        }

        get.addRequestHeader("Cache-Control", "no-cache");
        get.addRequestHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");//sun.net.www.protocol.http.HttpURLConnection.userAgent);
        get.addRequestHeader(HTTPHeaderName.CONNECTION.httpStringValue(), "close");
        get.setFollowRedirects(false);
        HttpClient client = HttpClientManager.getNewClient(30*1000, 10*1000);
        if(ants.p2p.Ant.proxied){
View Full Code Here

            request.handleError(server);
            return;
        }

        get.addRequestHeader("Cache-Control", "no-cache");
        get.addRequestHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");//sun.net.www.protocol.http.HttpURLConnection.userAgent);
        get.addRequestHeader(HTTPHeaderName.CONNECTION.httpStringValue(), "close");
        get.setFollowRedirects(false);
        HttpClient client = HttpClientManager.getNewClient(30*1000, 10*1000);
        if(ants.p2p.Ant.proxied){
          String tunnelHost = System.getProperty("https.proxyHost");
View Full Code Here

            return;
        }

        get.addRequestHeader("Cache-Control", "no-cache");
        get.addRequestHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");//sun.net.www.protocol.http.HttpURLConnection.userAgent);
        get.addRequestHeader(HTTPHeaderName.CONNECTION.httpStringValue(), "close");
        get.setFollowRedirects(false);
        HttpClient client = HttpClientManager.getNewClient(30*1000, 10*1000);
        if(ants.p2p.Ant.proxied){
          String tunnelHost = System.getProperty("https.proxyHost");
          int tunnelPort = Integer.getInteger("https.proxyPort").intValue();
View Full Code Here

      switch( param.getStyle() )
      {
      case HEADER :
        for( String valuePart : valueParts )
          httpMethod.addRequestHeader( param.getName(), valuePart );
        break;
      case QUERY :
        if( formMp == null || !request.isPostQueryString() )
        {
          for( String valuePart : valueParts )
View Full Code Here

      if ((pos = token.indexOf(":")) < 0) {
        return null;
      }
      name  = token.substring(0, pos).trim();
      value = token.substring(pos +1).trim();     
      httpMethod.addRequestHeader(name, value);

    }

    // set body if post method or put method
    if (body != null && body.length() > 0) {
View Full Code Here

      if ((pos = token.indexOf(":")) < 0) {
        return null;
      }
      name  = token.substring(0, pos).trim();
      value = token.substring(pos +1).trim();     
      httpMethod.addRequestHeader(name, value);

    }

    // set body if post method or put method
    if (body != null && body.length() > 0 && (httpMethod instanceof PostMethod || httpMethod instanceof PutMethod)) {
View Full Code Here

        // propagate headers as HTTP headers
        for (Map.Entry<String, Object> entry : in.getHeaders().entrySet()) {
            String headerValue = in.getHeader(entry.getKey(), String.class);
            if (strategy != null && !strategy.applyFilterToCamelHeaders(entry.getKey(), headerValue, exchange)) {
                method.addRequestHeader(entry.getKey(), headerValue);
            }
        }

        // lets store the result in the output message.
        try {
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.