To give you a better understanding, this is my method I am using in the
webService to return the raw data. It's really basic WebRequest Functionality.
Mind you it might not be formatted nicely since I am using yahoo, but im sure
it will still be readable.
private string GetPage(string strURL)
{
try
{
WebRequest req = WebRequest.Create(strURL);
WebResponse res = req.GetResponse();
int ibuff = 0;
byte[] buffer = new byte[128];
Stream stream = res.GetResponseStream();
ibuff = stream.Read(buffer, 0, 128);
StringBuilder strRes = new StringBuilder("");
while (ibuff != 0)
{
strRes.Append(Encoding.ASCII.GetString(buffer, 0, ibuff));
ibuff = stream.Read(buffer, 0, 128);
}
return strRes.ToString();
}
catch (Exception ex)
{
return ex.Message + "\r\n" + "URL: " + strURL;
}
}
this returns the raw html data, no headers or anything, just plain html source.
By 'string format' I meant literally string data type.
On a side note: I did create another method for images, im testing it now and
in that I am actually creating header information with Accept and content-type
to see what I get from it.
--------------------------------------------------------------
The data can be in any format. "String format" is vague. Is that ASCII,
Unicode, etc? HTTP, I believe, specifies that the header text must use
ASCII codepoints. The "content" can be anything--specified by the Content-
type header.
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com