【发布时间】:2018-11-04 05:04:41
【问题描述】:
我正在尝试使用以下代码在我们的 asp.net mvc 应用程序中连接到我们的 wordpress api
public static string GetLifespeakBlogListings()
{
WebClient client = new WebClient();
string url = "https://lifespeak.com/wp-json/wp/v2/posts?categories=6";
string listings = client.DownloadString(url);
return listings;
}
但是我得到以下异常:
System.Security.SecurityException Failed to negotiate HTTPS connection with server.fiddler.network.https> HTTPS handshake to lifespeak.com (for #1) failed. System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
如果我从浏览器访问此提要,它可以正常工作https://lifespeak.com/wp-json/wp/v2/posts?categories=6
我假设我们的 wordpress 网站上的某些内容由于某种原因阻止了此请求。我可以配置什么来防止这种情况发生吗?如何确定原因?
【问题讨论】:
-
是的,谢谢,看起来这是 fiddler 的问题 - 我怀疑这也是应用程序的问题。将检查并确认
标签: asp.net wordpress system.net