React app + get no results / Network error

Hello,

I begin to use ElasticSearch, and I need to build a React App to get datas from an index. For this, I use a basic request to call my index :

    axios.get(url, {
      auth: {
        username: 'elastic',
        password: 'XXXXXXXXXXXXXXXXX'
      }})
   .then(results => {
     console.log(results);
   })
 .catch(error => {
   console.log(error.response);
  }); 

But, I get no results / or a Network error. I get the same problem with a fetch function.
With other APIs I get some results without problem.

Is there a possibility that the problem come from the CORS? Or from a mistake in my request?

Thanks for your help.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.