【发布时间】:2023-03-21 02:40:01
【问题描述】:
我正在尝试从 windows phone 8 将 httpwebrequest 发布到 Rest 服务,http 标头为:User-agent =@"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0;Trident/6.0; IEMobile/10.0 ;ARM;触控;微软;虚拟)" 以及帖子正文:payload=testvalue&item1=value;
从 REST 客户端发布时,相同的请求会返回响应
以下是windows phone 8代码中发生的异常
System.Net.WebException was caught
HResult=-2146233079
Message=The remote server returned an error: NotFound.
Source=System.Windows
InnerException: System.Net.WebException
HResult=-2146233079
Message=The remote server returned an error: NotFound.
Source=System.Windows
InnerException:
【问题讨论】:
-
确保您在帖子中使用流复制而不是流 -> unicode 字符串 -> 流
标签: .net windows-phone-7 c#-4.0 windows-phone-8