My code is:
HttpWebRequest req = null;
req = (HttpWebRequest)HttpWebRequest.Create(url);
req.Method = "POST"; // Post method
req.ContentType = "application/xml"; // content type
req.Accept = "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
req.Headers.Add("Pragma", "no-cache");
req.Headers.Add("Cache-Control", "no-cache");
// create sender and send
StreamWriter writer = new StreamWriter(req.GetRequestStream());
writer.WriteLine(request);
writer.Close();
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
BinaryReader br = new BinaryReader(resp.GetResponseStream());
byte[] data = br.ReadBytes(1000000);
File.WriteAllBytes("file1", data);
br.Close();
Console.ReadLine();
The code works fine when trying to download a known zip file.