Re: HttpRequest Question
- From: "Anthony Sullivan" <anthony@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 29 Mar 2007 08:44:13 -0400
Hi Latish,
The code that Patrice provided seems to be doing the same thing. I've uploaded a test page for you guys to look at. Here is the link. also included below is the code for that page. It's not terribly complex. What I believe to be happening is that the HttpWebRequest Object is parsing the XML much like a browser would. I don't believe that that translated result is what the server is delivering.
If you browse out to the link that the code is requesting and "view source" you'll see the raw xml, however if you look at what my code is outputting you can see that you get the transformed document instead.
Here is the link to my page.
http://armory.bobguild.net/default.aspx
Here is the link that the page is trying to request.
http://armory.worldofwarcraft.com/guild-info.xml?r=Duskwood&n=Band+%C3%B2f+Brothers&p=1
Here is the codebehind my page.
string URL = "http://armory.worldofwarcraft.com/guild-info.xml?r=Duskwood&n=Band+%C3%B2f+Brothers&p=1";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(URL);
//Get the data as an HttpWebResponse object
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
//Convert the data into a string (assumes that you are requesting text)
StreamReader sr = new StreamReader(resp.GetResponseStream());
String results = sr.ReadToEnd();
sr.Close();
Response.Write(results);
Thanks!
Anthony Sullivan
"Latish Sehgal" <latish.sehgal@xxxxxxxxx> wrote in message news:1175138486.902893.39580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Anthony
Could you give a sample page where you are able to see the xml source?
I tried the code with the url Patrice cited above, and it seems to
work.
string URL = "http://msdn.microsoft.com/globalrss/en-us/global-
msdn-en-us.xml";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(URL);
//Get the data as an HttpWebResponse object
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
//Convert the data into a string (assumes that you are
requesting text)
StreamReader sr = new StreamReader(resp.GetResponseStream());
String results = sr.ReadToEnd();
sr.Close();
.
- References:
- HttpRequest Question
- From: Anthony Sullivan
- Re: HttpRequest Question
- From: Anthony Sullivan
- Re: HttpRequest Question
- From: Latish Sehgal
- HttpRequest Question
- Prev by Date: Re: Caching until 23:59 o'clock...
- Next by Date: Re: HttpRequest Question
- Previous by thread: Re: HttpRequest Question
- Next by thread: Is there Any orkut API
- Index(es):
Relevant Pages
|