Skip to content

how to consume API from wordpress Public API ? #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yann-yinn opened this issue Jul 6, 2018 · 1 comment
Closed

how to consume API from wordpress Public API ? #381

yann-yinn opened this issue Jul 6, 2018 · 1 comment
Milestone

Comments

@yann-yinn
Copy link

yann-yinn commented Jul 6, 2018

Hello !
First, thanks for this awesome client, which , i love so much the simplicity of it * - *

const posts = await wpapi
      .posts()
      .tags(tag.id)
      .perPage(10)
      .embed()
      .page(currentPage);

My question : I am working on Reactpress and would like to consume a wordpress public api, like this one , for testing purposes :

https://public-api.wordpress.com/wp/v2/sites/yinrun.wordpress.com

I tried this with no luck

import WPAPI from "wpapi";
import config from "./publicConfig";
export default new WPAPI({
  endpoint: "https://public-api.wordpress.com/wp/v2/sites/yinrun.wordpress.com"
});

I know there is a trick with namespace, but it means every request has to be rewritten : #329

Any suggestions ?

@kadamwhite kadamwhite added this to the 2.0 milestone Dec 21, 2018
@kadamwhite
Copy link
Collaborator

Closing as a duplicate of #329 -- there's no good suggestion currently but I've added documenting or solving this to our 2.0 milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants