Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to get started: connection closed unexpectedly #94

Open
erikdietrich opened this issue Aug 24, 2018 · 1 comment
Open

Trying to get started: connection closed unexpectedly #94

erikdietrich opened this issue Aug 24, 2018 · 1 comment

Comments

@erikdietrich
Copy link

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.

@Blackcat156
Copy link

I encountered the same situation.
Please check your IE browser proxy settings and cancel all options about agents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants