[UWP]如果我将Nugets .netCore.UniversalWindowsPlateform v5.1升级到v5.2.2我的HttpWebRequest" POST"停止工作 [英] [UWP]If I upgrade Nugets .netCore.UniversalWindowsPlateform v5.1 to v5.2.2 my HttpWebRequest "POST" stop working
问题描述
嗨
我注意到了UniversalWindowsPlateform的v5.2和5.1之间的某些内容
我在v5.1中有一个应用程序,并且执行了"POST"操作。操作HttpWebRequest,主体中的参数以UTF8编码。 (模拟在网站上登录)
如果升级到v5 .2,我的POST停止工作!
我恢复到v5.1它再次运作!
你有什么想法吗?
mycode的摘录
HttpWebRequest request =(HttpWebRequest)WebRequest。
< p style ="color:#222222; font-family:arial,sans-serif; font-size:12.8px"> request.CookieContainer = new CookieContainer();
ASCIIEncoding encoding = new ASCIIEncoding();
// Encoding.UTF8.GetBytes(
byte [] postData = Encoding.UTF8.GetBytes (所有 para
//所有 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
Hi
I 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 mycode
HttpWebRequest request = (HttpWebRequest)WebRequest.
request.CookieContainer = new CookieContainer();
ASCIIEncoding encoding = new ASCIIEncoding();
//Encoding.UTF8.GetBytes(
byte[] postData = Encoding.UTF8.GetBytes(allpara
//allparamin_body
request.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"停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!