I have the following code to send a gz compressed file:
byte[] gzFile = File.ReadAllBytes("gz file path here");
WebRequest request = WebRequest.Create("webservice url here");
request.Method = "POST";
request.ContentLength = gzFile.Length;
request.ContentType = "application/gzip";
Stream stream = request.GetRequestStream();
stream.Write(pdfFile, 0, gzfFile.Length);
stream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
Console.WriteLine(reader.ReadToEnd());
reader.Close();
But how do I specify the user and the pass requested by the REST webservice?