private static DO_HTTP ( |
||
uri | ||
proxy | IWebProxy | |
nodelay | bool | |
timeout_ms | int | |
return | Stream |
private static Stream DO_HTTP(Uri uri, IWebProxy proxy, bool nodelay, int timeout_ms, params string[] headers)
{
Stream stream = ConnectStream(uri, proxy, nodelay, timeout_ms);
int redirects = 0;
do
{
if (redirects > MAX_REDIRECTS)
throw new TooManyRedirectsException(redirects, uri);
redirects++;
foreach (string header in headers)
WriteLine(header, stream);
WriteLine(stream);
stream.Flush();
}
while (ReadHttpHeaders(ref stream, proxy, nodelay, timeout_ms));
return stream;
}