v1.2.0+1
wordpress_api
一个支持 WooCommerce 和自定义命名空间的 Dart 语言 WordPress REST API 客户端。
102喜欢 90近 30 天下载145Pub 分数
AndroidiOSWebmacOSWindowsLinux
一个支持 WooCommerce 和自定义命名空间的 Dart WordPress API 客户端。
以下为英文项目原文快照,最新内容请访问 GitHub。
A WordPress REST API client for dart with support for WooCommerce and custom namespaces/endpoints.
In the dependencies: section of your pubspec.yaml, add the following line:
dependencies:
wordpress_api: <latest_version>
import 'package:wordpress_api/wordpress_api';
WordPressAPI api = WordPressAPI('wp-site.com');
Retrieve posts from .posts getter
.posts. More arguments can be passed to further filter the data returned void main() async {
final api = WordPressAPI('wp-site.com');
final WPResponse res = await api.posts.fetch();
for (final post in res.data) {
print(post.title);
}
}
v0.3.0, you can query a single post from the same endpoint by passing an id void main() async {
final api = WordPressAPI('wp-site.com');
final WPResponse res = await api.posts.fetch(id: 1);
print(res.data.title);
}
Retrieve data from a custom endpoint
void main() async {
final api = WordPressAPI('wp-site.com');
final WPResponse res = await api.get(endpoint: 'your-custom-endpoint');
print(res.data);
}
Application Passwords. WordPress 5.6+ onlyContributions are welcome, report any issues here
Thanks goes to these wonderful people (emoji key):
anKii 💻 |
Kellvem Barbosa 💻 |
NKlage 💻 🐛 |
Elikem (Junior) Medehou 💻 |
Okan Demir 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
依赖清单 5 项
^1.15.0^5.5.0+1^0.15.0^2.4.0^4.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗