Hi,
I'm developing a windows application in C# which gets a xml string from
another website. To get the xml I'm using the following lines of code.
<cut>
XmlUrlResolver resolver = new XmlUrlResolver();
NetworkCredential myCred = new NetworkCredential("myusername",
"mypassword", "http://del.icio.us/api/tags/get?");
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri("http://del.icio.us/api/tags/get?"), "Basic",
myCred);
//resolver.Credentials = CredentialCache.DefaultCredentials;
resolver.Credentials = myCache;
XmlTextReader rdr = new
XmlTextReader("http://del.icio.us/api/tags/get?");
rdr.XmlResolver = resolver; // Set the resolver.
</cut>
The code works fine, but when I try to get the xml I receive an error:
"authorization required". This is because the visual studio application
identifies itself other than a normal browser.
Is it possible to set the user agent for my program?
Thanks,
Aart