1.通过允许跨域访问实现了跨域请求,但为了使每个请求带上session信息,我设置了withCredentials ,即: axios.defaults.withCredentials = true 然后跨域请求时会出现如下问题: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response
直接写成啦一个MyNet.cs类方便使用 get/post方法请求 //get请求 MyNet.SendRequest("http://www.baidu.com"); //post请求 var param = new Dictionary<string, string> { {"a","this is a param" }, {"b","this second param"} }; MyNet