////////////////////////////////////////////////////////////////////////////
            
        // authenticator can be null 
        private HttpWebRequest buildGetRequest(HttpRequestAdapter requestAdapter, Authenticator authenticator)
        {

            String host = _networkAddress.getHostAddress();
            int port = _networkAddress.Port;

            String requestUri = requestAdapter.RequestUri;


            String uri = String.Format("http://{0}:{1}{2}", host, port, requestUri);
            log.debug(uri, "uri");

            HttpWebRequest answer = (HttpWebRequest)HttpWebRequest.Create(uri);
            answer.Method = "GET";


            // extra headers ... 
            {
                Dictionary<String, String> requestHeaders = requestAdapter.RequestHeaders;
                foreach (KeyValuePair<String, String> kvp in requestHeaders)
                {
                    answer.Headers[kvp.Key] = kvp.Value;

                }
                
            }

            if (null != authenticator)
            {
                String authorization = authenticator.getRequestAuthorization(answer.Method, requestUri, null);
                log.debug(authorization, "authorization");
                if (null != authorization)
                {
                    answer.Headers["Authorization"] = authorization;
                }

            }

            // vvv http://haacked.com/archive/2004/05/15/http-web-request-expect-100-continue.aspx 

            answer.ServicePoint.Expect100Continue = false;

            // ^^^ http://msdn.microsoft.com/en-us/library/system.net.webrequest.getrequeststream.aspx#Y600 

            return answer;


        }
        ////////////////////////////////////////////////////////////////////////////

        // authenticator can be null
        private HttpWebRequest buildPostRequest(HttpRequestAdapter requestAdapter, Authenticator authenticator)
        {
            String host = _networkAddress.getHostAddress();
            int port = _networkAddress.Port;

            String requestUri = requestAdapter.RequestUri;


            String uri = String.Format("http://{0}:{1}{2}", host, port, requestUri);
            log.debug(uri, "uri");

            HttpWebRequest answer = (HttpWebRequest)HttpWebRequest.Create(uri);
            answer.Method = "POST";


            // extra headers ... 
            {
                Dictionary<String, String> requestHeaders = requestAdapter.RequestHeaders;
                foreach (KeyValuePair<String, String> kvp in requestHeaders)
                {
                    answer.Headers[kvp.Key] = kvp.Value;

                }

            }

            if (null != authenticator)
            {
                String authorization = authenticator.getRequestAuthorization(answer.Method, requestUri, null);
                log.debug(authorization, "authorization");
                if (null != authorization)
                {
                    answer.Headers["Authorization"] = authorization;
                }

            }

            Entity requestEntity = requestAdapter.RequestEntity;
            Stream destinationStream = answer.GetRequestStream();
            bool failed = true;
            try
            {
                // vvv http://haacked.com/archive/2004/05/15/http-web-request-expect-100-continue.aspx 

                answer.ServicePoint.Expect100Continue = false;

                Entity entity = requestAdapter.RequestEntity;
                StreamHelper.write(entity.getContentLength(), entity.getContent(), answer.GetRequestStream());

                // ^^^ http://msdn.microsoft.com/en-us/library/system.net.webrequest.getrequeststream.aspx#Y600 

                failed = false;
            }
            finally
            {
                bool swallowExceptions = false;
                if( failed ) { 
                    swallowExceptions = true;
                }

                StreamHelper.close(requestEntity.getContent(), swallowExceptions, this);
                StreamHelper.close(destinationStream, swallowExceptions, this);
            }

            return answer;
        }