"401 Unauthorized" returned in cookieless mode

D

Daatmor

Hi,

I've worte a program that will grab the html file content from web server.
It's work

------------------------------------------------------------------------------------------------------------------------------
string strURL = "http://127.0.0.1/webapp/requestview.aspx?id=1185";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL);
HttpWebResponse response = null;
NetworkCredential credentials = new NetworkCredential("abc", "password",
"svr001");
request.Credentials = credentials;
response = (HttpWebResponse)request.GetResponse();
------------------------------------------------------------------------------------------------------------------------------

But when I change Cookieless to "true" in web.config file, the URL will
redirect to other URL with session id

http://127.0.0.1/webapp/(fadfasdfaderew908rfdfas)/requestview.aspx?id=1185

And I will receive "401 Unauthorized" from WebException when I call
request.GetResponse().


How can I solve this problem? and grab the file content

Thanks


Daatmor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top