forked from wp-net/WordPressPCL
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Thomas Pentenrieder edited this page Oct 27, 2017
·
11 revisions
Welcome to the WordPressPCL wiki!
WordPressPCL requires:
- Wordpress 4.7+ https://wordpress.org/
- JWT Auth plugin (for requests requiring authentication) https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/
WordPressPCL is built on top of the new .NET Standard targeting netstandard version 1.1 - therefore it should work on the following plaforms:
- .NET Framework 4.5 and newer
- .NET Core
- Universal Windows Platform (uap)
- Windows 8.0 and newer
- Windows Phone (WinRT, not Silverlight)
- Mono / Xamarin
The WordPressPCL API Wrapper is avaiable through nuget:
> Install-Package WordPressPCL
If you execute requests required authentication you must install JWT Auth plugin and configure it. You must enable Auth Headers and defune your secret key More info https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/#description
using WordPressPCL;
// Initialize
var client = new WordPressClient("http://demo.wp-api.org/wp-json/");
//Auth
await client.RequestJWToken("username","password");
// Get All Posts
var posts = await client.Posts.GetAll();