Package com.ning.http.client.AsyncHttpClient

Examples of com.ning.http.client.AsyncHttpClient.BoundRequestBuilder.addHeader()


                }
              }//TESTED (1.5, 1.6, 3.*, 4.*)
              if (null != request.httpFields) {
                for (Map.Entry<String, String> keyValue: request.httpFields.entrySet()) {
                  if (!keyValue.getKey().equalsIgnoreCase("content")) {
                    asyncRequest = asyncRequest.addHeader(keyValue.getKey(), keyValue.getValue().replace("$1", entityValue));
                  }
                }             
              }//TESTED (by hand, "http://httpbin.org/cookies", "httpFields": { "Cookie": "mycookie=test" }
              if (null != postContent) {
                asyncRequest = asyncRequest.setBody(postContent.replace("$1", entityValue));
View Full Code Here


        AHCPathBuilder path = _server.rootPath();
        path = _pathFinder.appendStoreEntryPath(path);
        path = _keyConverter.appendToPath(path, contentId);      
        BoundRequestBuilder reqBuilder = path.getRequest(_httpClient);
        // plus, allow use of GZIP and LZF
        reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_ACCEPT_COMPRESSION,
                "lzf, gzip, identity");
        // and may use range as well
        if (range != null) {
            reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_RANGE_FOR_REQUEST,
                range.asRequestHeader());
View Full Code Here

        // plus, allow use of GZIP and LZF
        reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_ACCEPT_COMPRESSION,
                "lzf, gzip, identity");
        // and may use range as well
        if (range != null) {
            reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_RANGE_FOR_REQUEST,
                range.asRequestHeader());
        }
       
        int statusCode = -1;
        UncompressingAsyncHandler<T> handler = new UncompressingAsyncHandler<T>(processor);
View Full Code Here

        AHCPathBuilder path = _server.rootPath();
        path = _pathFinder.appendPath(path, PathType.STORE_ENTRY);
        path = _keyConverter.appendToPath(path, contentId);      
        BoundRequestBuilder reqBuilder = path.getRequest(_httpClient);
        // plus, allow use of GZIP and LZF
        reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_ACCEPT_COMPRESSION,
                "lzf, gzip, identity");
        // and may use range as well
        if (range != null) {
            reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_RANGE_FOR_REQUEST,
                range.asRequestHeader());
View Full Code Here

        // plus, allow use of GZIP and LZF
        reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_ACCEPT_COMPRESSION,
                "lzf, gzip, identity");
        // and may use range as well
        if (range != null) {
            reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_RANGE_FOR_REQUEST,
                range.asRequestHeader());
        }
       
        int statusCode = -1;
        UncompressingAsyncHandler<T> handler = new UncompressingAsyncHandler<T>(processor);
View Full Code Here

        AHCPathBuilder path = _server.rootPath();
        path = _pathFinder.appendStoreEntryPath(path);
        path = _keyConverter.appendToPath(path, contentId);      
        BoundRequestBuilder reqBuilder = path.getRequest(_httpClient);
        // plus, allow use of GZIP and LZF
        reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_ACCEPT_COMPRESSION,
                "lzf, gzip, identity");
        // and may use range as well
        if (range != null) {
            reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_RANGE_FOR_REQUEST,
                range.asRequestHeader());
View Full Code Here

        // plus, allow use of GZIP and LZF
        reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_ACCEPT_COMPRESSION,
                "lzf, gzip, identity");
        // and may use range as well
        if (range != null) {
            reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_RANGE_FOR_REQUEST,
                range.asRequestHeader());
        }
       
        int statusCode = -1;
        UncompressingAsyncHandler<T> handler = new UncompressingAsyncHandler<T>(processor);
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.