"This stream does not support seek operations" while HTTPWebRequest making
<p>I have such piece of code:</p>

<pre><code>var uri = "myURL.com"
var request = (HttpWebRequest)WebRequest.Create(uri);
string postData = "myData";
byte[] data = Encoding.UTF8.GetBytes(postData);

request.Method = "POST";
request.UseDefaultCredentials = true;
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
request.AddRange(1024);
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36";

Stream stream = request.GetRequestStream();
stream.Write(data, 0, data.Length);
WebResponse response = request.GetResponse();
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
response.Close();
stream.Close();
</code></pre>

<p>And I get an exception like: "This stream does not support seek operations". This error occurs in <code>stream.Length</code> and <code>stream.Position</code>. And I although think, that because of this error my <code>postData</code>doesn't sent to the server.
<a href="http://i.stack.imgur.com/jPI16.png" rel="nofollow">Here is the screenshot of the exception</a></p>