Here's how i do it, hope it helps:
protected string GetPage(string Page,System.Text.Encoding encoding,string
Method)
{
HttpWebRequest JobSiteRequest = (HttpWebRequest)WebRequest.Create(Page);
JobSiteRequest.Method = Method;
HttpWebResponse JobSiteResponse =
(HttpWebResponse)JobSiteRequest.GetResponse();
Stream JobSiteStream = JobSiteResponse.GetResponseStream();
StreamReader JobSiteData = new StreamReader(JobSiteStream,encoding);
string Data = JobSiteData.ReadToEnd();
JobSiteStream.Close();
JobSiteResponse.Close();
return Data;
}
"Mark Rae" <ma**@markrae.co.uk> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
Hi,
Can anyone please tell me if it's possible to use HttpWebRequest and
HttpWebResponse in a class in a Windows application? I've tried
referencing System and System.Web but there's still something missing.
Any assistance gratefully received.
Best,
Mark Rae