1

我正在尝试在我们的 Web 服务器上调用 API,该 API 允许我们在 Wordpress 站点中创建用户帐户。

如果我在浏览器中输入 URL,它就可以正常工作。如果我尝试通过代码调用它,则会出现以下错误:-

The remote server returned an error: (404) Not Found.

这是我正在使用的代码

string URL = "http://api.mywebsite.com/pol-wp/api/user/register/?username=john&email=test@test.comm&nonce=7706960c14&display_name=John&notify=both&user_pass=xxx&insecure=cool";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
request.Method = "GET";
request.ContentLength = 0;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

更新:在 Chrome 中粘贴 URL 可以正常工作,但将其粘贴到 IE 会产生“未找到”错误消息

4

0 回答 0