Silverlight httpwebrequest cannot be included in Header .aspxauth cookie

Now I have a silverlight application that fetches data from the mvc website. As long as I use WebClient and GET requests, everything seems to be fine. However, when I use HttpWebRequest and POST, I Encountered an authentication problem.

The problem stems from a missing request for the .ASPXAUTH cookie.

Does anyone know how to resolve or resolve this issue?

Write the following code before making the HttpWebRequest object.

< /p>

System.Net.WebRequest.RegisterPrefix(“http://”, WebRequestCreator.BrowserHttp);
System.Net.WebRequest.RegisterPrefix(“https://”, WebRequestCreator.BrowserHttp );

Then create the HttpWebRequest object.

// Create request
HttpWebRequest request = HttpWebRequest.CreateHttp(” http://zainshaikh.posterous.com/”);

Hope this helps.

Now I have one from mvc The silverlight application where the website fetches data. As long as I use WebClient and GET requests, everything seems to be ok. However, when I use HttpWebRequest and POST, I have problems with authentication.

Problems The request stems from a missing .ASPXAUTH cookie.

Does anyone know how to solve or solve this problem?

Write the following code before making the HttpWebRequest object.

System.Net .WebRequest.RegisterPrefix(“http://”, WebRequestCreator.BrowserHttp);
System.Net.WebRequest.RegisterPrefix(“https://”, WebRequestCreator.BrowserHttp);

Then create the HttpWebRequest object.

// Create request
HttpWebRequest request = HttpWebRequest.CreateHttp(“http://zainshaikh.posterous.com/”) ;

Hope this helps.

Leave a Comment

Your email address will not be published.