Closed Marneus77 closed 6 years ago
Ah, I had not seen yet that wordpress.com supports the new REST API as well. We should certainly enable this!
How long do you think it will take?
It's gonna be a bit more work than just omitting the /wp-json/ since the default paths baked into the sub-methods (e.g. /wp/v2/comments) will have to be touched as well. Not sure yet whether we should add a flag for wordpress.com sites. Also, we'll have to figure out how authentication will work with wordpress.com sites.
I saw that with a business plan you can install the jwt authentication plugin. I'll wait or find another way. Thanks for the great support.
I had a look at the code, and saw that the wp-json at the end was added with pull 78. (WordPressClient.cs, line 140) The defaultPath (/wp/v2/) used for requests could then effectively be changed with a flag.
I just updated the nuget package with a fix to not append /wp-json to the uri anymore. Still, that won't be enough to get wordpress.org sites working just yet.
Thanks for the info. I compiled a version for me in the meantime. It's working great.
Ok, I'll close this for now and will open another issue explicitly for wordpress.com support.
Hi,
The wordpress client constructor seems to be appending "/wp-json/" to the uri when it doesn't end with it. This prevents the possibility to use WordPressPCL on Blogs hosted on wordpress.com, for their Rest Api Url is like https://public-api.wordpress.com/wp/v2/sites/{name_of_the_site}.wordpress.com/