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

Always 404 #10

Closed caam1406 closed 4 years ago

caam1406 commented 4 years ago

I'm try do work with the sample: import 'package:wordpress_api/wordpress_api.dart';

WordPressAPI api = WordPressAPI('https://jsonplaceholder.typicode.com/');

void main() async { final wp = WordPressAPI('https://jsonplaceholder.typicode.com/posts'); final posts = await wp.getPosts(); for (final post in posts) { print(post.title['rendered']); } } But always return 404: Exception: DioError [DioErrorType.RESPONSE]: Http status error [404]

0 WordPressAPI.getAsyc (package:wordpress_api/src/main.dart:249:7)

#1 WordPressAPI.getPosts (package:wordpress_api/src/main.dart:281:23) #2 main (package:mercurio_comunicator/getcardContent.dart:7:26) #3 _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19) #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
theeomm commented 4 years ago

This package is a WordPress API wrapper and can only be used with a WordPress site. 'https://jsonplaceholder.typicode.com is not a WordPress powered website.

caam1406 commented 4 years ago

Thanks;