Ejemplo n.º 1
0
        public override string SendRequest(string url, KeyValuePair<string, string>[] parameters, WebProxy proxy)
        {
            var buffer = parameters.ToPostBuffer();

            var request = (HttpWebRequest) WebRequest.Create(url);
            request.ContentType = "application/x-www-form-urlencoded";
            request.Method = "POST";
            request.Proxy = proxy ?? WebRequest.DefaultWebProxy;

            request.ContentLength = buffer.Length;

            var postStream = request.GetRequestStream();
            postStream.Write(buffer, 0, buffer.Length);
            postStream.Close();

            return GetResponse(request);
        }