#How to make request using private networking?

16 messages · Page 1 of 1 (latest)

queen willow
#

I have two services and want to make a call from service A to service B using private networking. When I try to make a request, I get the error:

Mixed Content: The page at '[...]' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '[...]'. This request has been blocked; the content must be served over HTTPS

I'm using http as specified in the docs here.

My request looks like this:

    let url4 = "http://[service-name].railway.internal:8080/api/home";
    axios
      .post(url4)
      .then((res) => {
        const r = res.data;
        alert(r["message"]);
      })
      .catch((err) => {
        alert(url4 + err);
      });

The request works when I make it via public networking.

Project ID: 1031bd42-29fd-490d-aa39-3bffdaef2fb1

gilded spokeBOT
#

Project ID: 1031bd42-29fd-490d-aa39-3bffdaef2fb1

safe coyoteBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

lime tree
queen willow
#

I have linked this page in my question and followed the exact steps to make a query there and the server does receive it but the http request is rejected because it's not https

lime tree
#

are you making the request from within the browser on the client side?

queen willow
#

I am making the request in nextjs via axios

lime tree
#

is the request made by the browser or by the backend

queen willow
#

I don't know but I assume it's the browser

lime tree
queen willow
#

oh, I see
That does make a lot of sense now

#

Thank you so much!

#

I will remember to read everything next time, sorry

safe coyoteBOT
lime tree
#

no worries, the docs are there to help you, and I'm here to fill in the gaps

queen willow
#

Thanks so much!!