I wanted to start learning React.js and for this I decided to do a theme written in React for my wordpress, using the 'new' WP API functionality. How do I access the API from my computer? I know I have to authorize the API call, but I do not know how to do it. Here's 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 I call the Url returned by Json.
How can I allow access?