wp-net / WordPressPCL

This is a portable library for consuimg the WordPress REST-API in (almost) any C# application
MIT License
338 stars 129 forks source link

"No route was found matching the URL and request method" when creating client #202

Closed audigex closed 4 years ago

audigex commented 4 years ago

I've attempted to use the example code on the readme page with the following three API URI's:

http://192.168.0.222:8080/wp-json/wp/v2/ http://192.168.0.222:8080/wp-json/wp/ http://192.168.0.222:8080/wp-json/

And for the username and password, I've passed in both a valid (admin) user, and a valid OAUTH key/secret.

var client = new WordPressClient(apiUri);
client.AuthMethod = AuthMethod.JWT;
await client.RequestJWToken(username, password); // Exception thrown here, I believe
var isValidToken = await client.IsValidJWToken();

if(isValidToken)
{
    // Do API things
}

What am I doing wrong?