'How to connect react app to remote backend (asp.net) and make http request

thanks to all guys who read and reply on my post.

I have a react app and i have a remote server to which i need to make http request and fetch data. the backend is in asp.net , usually when i am working on react-node i would add proxy:localhost:3000 in package.json file and its almost same when your backend is also on local system but i have backend which is remote , how do i make http request.

i have tried everything but it keeps giving this error:

Eerrr fetching the data : Error: Network Error
    at createError (createError.js:16:1)
    at XMLHttpRequest.handleError (xhr.js:117:1)

http request with axios::

  try {
    const { data } = await axios.get(
      "https://3.26.25.175:5001/api/v1/AdminPanel/status",

      {
        headers: {
          Authorization: `Bearer ${keycloak.token}`,
          "Content-Type": "application/json",
        },
      }
    );

error image



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source