0
I wanted to start learning React.js and for this I decided to make a theme written in React for my wordpress, using the 'new' functionality WP API. How do I get access to the API from my computer? I know I have to authorize the call to the API, but I don’t know how to do it. See how I’m trying to get the information:
componentDidMount() {
let dataURL = "http://meusite.com/wp-json/wp/v2/books?_embed";
fetch(dataURL)
.then(res => res.json())
.then(res => {
this.setState({
movies: res
})
})
}
I get error 425 (visible from Chrome devtools) when calling the URL that returns Json.
How can I allow access?