ASP.NET MVC routing issue with Google Chrome client

假装没事ソ 提交于 2019-12-01 12:54:43

This doesn't directly answer your question, but I would suggest you try Fiddler, and look at the actual request that is being sent by the browser. Compare the differences and try to figure out what's going wrong (you can use the "Request Builder" tab in Fiddler to eh-hm, fiddle with the parameters).

What I discovered is that two methods of WebRequest: Create and CreateHttp behave differently when using HTTPS. Always use Create method to instantiate the right request according to a protocol. I had similar situation and that what I've got. For the following code we have Not Found exception when trying to get some content using WebRequest:

HttpWebRequest request = WebRequest.CreateHttp(uri); 

But the following piece works well:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);

Ok, I found a way to solve this problem. In my silverlight app I opted for using client stack instead of using default http stack.

WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
WebRequest.RegisterPrefix("https://", WebRequestCreator.ClientHttp);

See also: http://blogs.msdn.com/b/silverlight_sdk/archive/2009/08/12/new-networking-stack-in-silverlight-3.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!