Ejemplo n.º 1
0
        private HttpResponse SendRequestAndGetResponse(HttpConnection connection, HttpRequest request)
        {
            m_cookieStore.WriteCookiesToRequest(request);

            // if we need to send a body (not only headers)
            if (request.GetType().GetInterface("HttpEntityEnclosingRequest") != null)
            {
                HttpEntityEnclosingRequest heer = (HttpEntityEnclosingRequest)request;
                connection.SendRequestHeaderAndEntity(request, heer.Entity, heer.ExpectContinue);
            }
            else
            {
                connection.SendRequestHeader(request);
            }

            return GetResponse(connection);
        }