You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I've installed the NuGet package and am trying to follow the example here, which seems pretty simple. But, I'm getting an error right out of the gate implementing this in a console app, "System.Net.WebException: 'The underlying connection was closed: The connection was closed unexpectedly.'"
The call stack isn't super helpful and eventually tracks to HttpWebRequest.GetResponse(). So I guess there must be something that I'm doing wrong with the API here, but it's hard to fathom what, since I know that the blog, username, and password are right and this is not a multsite blog. I also know that the post in question exists, but, just in case, I tried calling other methods on the client API with the same result.
var config = new WordPressSiteConfig()
{
BaseUrl = "https://daedtech.com/",
BlogId = 1,
Username = "elided",
Password = "elided"
};
using (var client = new WordPressClient(config))
{
var post = client.GetPost(11160); //Post with this id definitely exists -- exception is thrown here
Console.WriteLine(post.Author);
}
Console.ReadLine();
If anyone could point out what I'm doing wrong, I'd really appreciate it. If I could avoid rolling my own Wordpress API client, I'd definitely prefer to.
Thanks.
The text was updated successfully, but these errors were encountered:
Hello. I've installed the NuGet package and am trying to follow the example here, which seems pretty simple. But, I'm getting an error right out of the gate implementing this in a console app, "System.Net.WebException: 'The underlying connection was closed: The connection was closed unexpectedly.'"
The call stack isn't super helpful and eventually tracks to HttpWebRequest.GetResponse(). So I guess there must be something that I'm doing wrong with the API here, but it's hard to fathom what, since I know that the blog, username, and password are right and this is not a multsite blog. I also know that the post in question exists, but, just in case, I tried calling other methods on the client API with the same result.
If anyone could point out what I'm doing wrong, I'd really appreciate it. If I could avoid rolling my own Wordpress API client, I'd definitely prefer to.
Thanks.
The text was updated successfully, but these errors were encountered: