Package org.apache.commons.httpclient

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


        HttpMethod method = new GetMethod(uri);
        for (String name : headerSet) {
            if ("WWW-Authenticate".equalsIgnoreCase(name)) {
                continue;    // this is a response header
            }
            method.addRequestHeader(name, name);
        }

        HttpClientExecutionCollectionAspect aspectInstance = getAspect();
        HttpObfuscator obfuscator = aspectInstance.getHttpHeadersObfuscator();
        if (!defaultHeaders) {
View Full Code Here


        if (!defaultHeaders) {
            for (String name : HttpObfuscator.DEFAULT_OBFUSCATED_HEADERS_LIST) {
                if ("WWW-Authenticate".equalsIgnoreCase(name)) {
                    continue;    // this is a response header
                }
                method.addRequestHeader(name, name);
            }
            obfuscator.incrementalUpdate(HttpObfuscator.OBFUSCATED_HEADERS_SETTING, StringUtil.implode(headerSet, ","));
        }

        int response = httpClient.executeMethod(method);
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

        // Note that syndFeedInfo will be null if it is not in the cache
      SyndFeedInfo syndFeedInfo = feedInfoCache.getFeedInfo(feedUrl);     
             
      // retrieve feed
      HttpMethod method = new GetMethod(urlStr);
      method.addRequestHeader("Accept-Encoding", "gzip");
      try {
        if (isUsingDeltaEncoding()) {
            method.setRequestHeader("A-IM", "feed");
        }     
         
View Full Code Here

                // add the value(s) as a http request header
                if (values.size() > 0) {
                    // use the default toString of a ArrayList to create in the form [xxx, yyy]
                    // if multi valued, for a single value, then just output the value as is
                    String s =  values.size() > 1 ? values.toString() : values.get(0);
                    method.addRequestHeader(key, s);
                }
            }
        }

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

                // add the value(s) as a http request header
                if (values.size() > 0) {
                    // use the default toString of a ArrayList to create in the form [xxx, yyy]
                    // if multi valued, for a single value, then just output the value as is
                    String s =  values.size() > 1 ? values.toString() : values.get(0);
                    method.addRequestHeader(key, s);
                }
            }
        }

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

    //
    // Make another proxied request, this time send the cookie
    //
    String cookieurl = PROXY_URL+"?instanceid_key="+instance_id_key+"&url=http://localhost:9000";
    req = new GetMethod(cookieurl);
    req.addRequestHeader("Cookie", "test=wookie");
    client.executeMethod(req);
    code = req.getStatusCode();
    header = req.getResponseHeader("GOT-COOKIE").getValue();

    req.releaseConnection();
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

        //else if(multi!=null)multi.addParameter(param.getName(),param.getValueAsString());
      }
    // CGI
      else if(type.equals("cgi")) {
        if(param.getEncoded())
            httpMethod.addRequestHeader(
                            translateEncoding(param.getName(),http.charset),
                            translateEncoding(param.getValueAsString(),http.charset));
                else
                    httpMethod.addRequestHeader(param.getName(),param.getValueAsString());
      }
View Full Code Here

        if(param.getEncoded())
            httpMethod.addRequestHeader(
                            translateEncoding(param.getName(),http.charset),
                            translateEncoding(param.getValueAsString(),http.charset));
                else
                    httpMethod.addRequestHeader(param.getName(),param.getValueAsString());
      }
        // Header
            else if(type.startsWith("head")) {
              if(param.getName().equalsIgnoreCase("content-type")) hasContentType=true;
             
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.