本文档介绍了用于简化 WordPress REST API 交互的客户端库,这些库支持多种编程语言,便于外部应用程序连接。但请注意,除 Backbone.js 客户端外,其他库非 WordPress 核心部分,且可能需要额外认证插件。
PHP
Requests for PHP is a general purpose HTTP request library. While not specifically designed for the WordPress REST API, it is a great tool for interacting with any HTTP API.
WordPress-PHP-SDK is a PHP SDK for the WordPress REST API, which can be installed using composer.
WordPress-SDK is a Laravel package for the WordPress REST API, which can be installed using composer.
JavaScript
The Backbone.js client is built in to WordPress core and provides Backbone.js models & collections for working with REST API resources.
node-wpapi is an isomorphic JavaScript client library for querying or writing to the REST API using an intuitive chaining syntax. It can be used with Node.js or with client-side JavaScript applications.
ember-wordpress provides a connection between Ember Data and the REST API
Ruby
wp-api-client: a read-only REST API client written in Ruby.
C# / .NET
WordPressPCL: a full REST API client written in C#.
Dart / Flutter
wordpress_client: A library exposing a fluent api to interact with the WordPress REST API. The API can be used from any application by sending basic HTTP requests; however, client libraries simplify the process of querying or creating specific resources. These libraries make it easy to connect an external application to the WordPress REST API using a variety of programming languages.
Aside from the Backbone.js client, these libraries are not part of WordPress core, and are not necessarily maintained or endorsed by the WordPress REST API team.
Requests for PHP is a general purpose HTTP request library. While not specifically designed for the WordPress REST API, it is a great tool for interacting with any HTTP API.
WordPress-PHP-SDK is a PHP SDK for the WordPress REST API, which can be installed using composer.
WordPress-SDK is a Laravel package for the WordPress REST API, which can be installed using composer.
The Backbone.js client is built in to WordPress core and provides Backbone.js models & collections for working with REST API resources.
node-wpapi is an isomorphic JavaScript client library for querying or writing to the REST API using an intuitive chaining syntax. It can be used with Node.js or with client-side JavaScript applications.
ember-wordpress provides a connection between Ember Data and the REST API
wp-api-client: a read-only REST API client written in Ruby.
WordPressPCL: a full REST API client written in C#.
wordpress_client: A library exposing a fluent api to interact with the WordPress REST API.