本文介绍了[UWP]如果我将Nugets .netCore.UniversalWindowsPlateform v5.1升级到v5.2.2我的HttpWebRequest" POST"停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嗨 我注意到了UniversalWindowsPlateform的v5.2和5.1之间的某些内容  我在v5.1中有一个应用程序,并且执行了"POST"操作。操作HttpWebRequest,主体中的参数以UTF8编码。 (模拟在网站上登录) 如果升级到v5 .2,我的POST停止工作! 我恢复到v5.1它再次运作! 你有什么想法吗? mycode的摘录 HttpWebRequest request =(HttpWebRequest)WebRequest。 Create(url rest.AbsoluteUri); request.CookieContainer = new CookieContainer(); ASCIIEncoding encoding = new ASCIIEncoding(); // Encoding.UTF8.GetBytes( postString); byte [] postData = Encoding.UTF8.GetBytes (所有 para m 在主体中); //所有 param in_body request.ContentType =" POST"; Stream newStream = await request.GetRequestStreamAsync(); newStream.Write(postData,0,postData.Length); newStream.Dispose(); response =(HttpWebResponse)await request.GetResponseAsync(); cdt 解决方案 v5会发生什么。 2?  您收到错误了吗?  我也更喜欢HttpClient到HttpWebRequest HiI notice something between the v5.2 and 5.1 of the UniversalWindowsPlateform I have an application in v5.1 and a do a "POST" opperation whith a HttpWebRequest , with parameter in the body encode in UTF8. (to simulate a login on a webSite)If a upgrade to v5.2, my POST stop working !I restore to v5.1 and it work again !Have you got an idea ?extract of mycodeHttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlrest.AbsoluteUri);request.CookieContainer = new CookieContainer();ASCIIEncoding encoding = new ASCIIEncoding();//Encoding.UTF8.GetBytes(postString);byte[] postData = Encoding.UTF8.GetBytes(allparaminbody);//allparamin_bodyrequest.ContentType = "POST";Stream newStream = await request.GetRequestStreamAsync();newStream.Write(postData, 0, postData.Length);newStream.Dispose();response = (HttpWebResponse)await request.GetResponseAsync();cdt 解决方案 what happens with v5.2?  Do you get an error?  I also prefer the HttpClient to the HttpWebRequest 这篇关于[UWP]如果我将Nugets .netCore.UniversalWindowsPlateform v5.1升级到v5.2.2我的HttpWebRequest" POST"停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-27 04:35