request.Accept = "text/html";
, .
, , , . , .
: , , 403 , Accept. ContentType , .
, , :
void MyFunction(string url)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.UserAgent = ".NET Framework Test Client";
request.Accept = "text/html";
Logger.WriteMyLog("application/x-www-form-urlencoded");
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
Stream resStream = response.GetResponseStream();
StreamReader streamReader = new StreamReader(
resStream,
Encoding.GetEncoding(response.CharacterSet)
);
httpData = streamReader.ReadToEnd();
}
}