本文介绍了Ajax请求https url的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所示,我在尝试在Visual Studio Express 2012中运行的Windows 8 Windows应用商店应用中(直接或通过WinJS.xhr函数)创建XMLHttpRequest时遇到问题。是对https网址的POST,其中包含"内容类型"
设置为"text / plain"。

As the title suggests, I'm having a problem with trying to make a XMLHttpRequest (either directly or via the WinJS.xhr function) in a Windows 8 Windows Store app running in Visual Studio Express 2012. The request is a POST to a https url, with "Content-type" set to "text/plain".

发出请求时,VS错误控制台出现以下错误:

I get the following error in the VS error console when the request is made:

XMLHttpRequest:网络错误0x2ef3,由于错误00002ef3无法完成操作。

XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3.

如果我将类型或方法切换为GET而不是POST,我只是从服务器返回预期的错误数据,抱怨使用了错误的请求类型。

If I switch the type or method to GET instead of POST, I just get the expected error data back from the server which complains about using the wrong request type.

我非常感谢有关这个问题的人。谢谢。

I would greatly appreciate anyone shedding some light on this issue. Thanks.

PS。几乎每个功能都在package.appxmanifest中启用。唯一不是文档库。以防万一是问题;)

PS. Pretty much every Capability is enabled in package.appxmanifest. The only one that is not is Document Library. Just in case that was the problem ;)

推荐答案

干杯。


这篇关于Ajax请求https url的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 15:03