Andrew Armstrong wrote:
6 or 7 times more code to handle a redirect? I think you're doing something
wrong.
You'd be surprised. The complete code required to pull a profile if the redirect wasn't there would be:

string ProfileXML = WebClient.DownloadString(ProfileURL); (C#.NET, Framework 2.0)

One line of code (not counting creating the WebClient object instance). With the redirect as it is now, I need to add to that:

- Manually get the headers for the page at ProfileURL.
- If it's not a redirect, get the page.
- If it's a redirect, check the URL it's redirecting to for ?xml=1 at the end.
- If that's not there, append it.
- Retrieve the resulting URL.

That's going to be at least 6 or 7 times more lines of code, including manually handling headers (which I should never have to do, that's the whole point of having a WebClient object with a nice tidy "DownloadString" method).

-Dave
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds

Reply via email to