Code example:

HttpWebRequest request =
   (HttpWebRequest)HttpWebRequest.Create("http://some.existing.url");

request.Method = "POST";
request.ContentType = "text/xml";

Byte[] documentBytes = GetDocumentBytes ();


using (Stream requestStream = request.GetRequestStream())
{
   requestStream.Write(documentBytes, 0, documentBytes.Length);
   requestStream.Flush();
   requestStream.Close();
}

When I do request.GetRequestStream(), there's nothing to send in the request. From the name of the method, and what the IntelliSense shows ("Get System.IO.Stream to use to write request data"), nothing indicates that this line of code will connect to a server, but it seems it does...

Can anyone explain to me what HttpWebRequest.GetRequestStream() does?

Edit
Report