A
A
Artem Andreev2019-03-02 11:42:11
JavaScript
Artem Andreev, 2019-03-02 11:42:11

How does the Wordpress Rest API plugin work?

Hello. I read a lot of examples about integrating React with Wordpress using the REST API plugin, but I had a question about accessing endpoints via links. Here is the code

componentDidMount() {
       return fetch(`http://www.aaaddd.com/wp-json/wp/v2/posts/`)  
       .then((response) => response.json())
       .then((responseJson) => {
        // Update state here        
       })
       .catch((error) => {
         console.error(error);
       });        
 }

My question is, will this link be available to third-party users (to which the fetch request goes)?
Unfortunately I couldn't find the answer to my question. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2019-03-02
@hzzzzl

I mean will the site user be able to see that react has made a request to ` http://www.aaaddd.com/wp-json/wp/v2/posts/`?
can in chrome console, yes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question