dhmgroup / dart-wp

A WordPress API client for dart with support for WooCommerce and custom namespaces.
https://pub.dev/packages/wordpress_api
BSD 3-Clause "New" or "Revised" License
79 stars 28 forks source link

No get method found. #24

Closed syan-park closed 3 years ago

syan-park commented 3 years ago

Hey, guys.

in your sample code. Retrieve data from a custom endpoint.

My code makes error. The method 'get' isn't defined for the type 'WordPressAPI'. Try correcting the name to the name of an existing method, or defining a method named 'get'.

  void main() async {
    final api = WordPressAPI('wp-site.com');
    final WPResponse res = await api.get(endpoint: 'your-custom-endpoint');
    print(res.data);
  }
theeomm commented 3 years ago

Sorry for the mistake. Forgot to update the example in the docs. get method has been changed to fetch. This was included in the changelog.