How to send http request

Hi.
I want to send http get request but discourse doesn’t allow me to send it and I see this error while sending this in firebug:
locked loading mixed active content
but I doesn’t have any problem with https request.
Our site is : https://padpors.com
what should I do for sending http request?

Can you explain a little more what you are trying to do?

Are you trying to link to an image on another http url?

If so I would recommend just uploading that image to discourse and then you don’t have to worry about in mixed content warnings.

4 Likes

no this isn’t an image.
I want to run this script:

$.getJSON("http://155.84.104.53:9295/ingest?id=100&url='padpors103'", function (data) { });
</script>```
I have puted this in header. It works in my local discourse but doesn't work in main site because of this error:
```locked loading mixed active content```
when I change the script to :
```<script>
$.getJSON("//155.84.104.53:9295/ingest?id=100&url='padpors103'", function (data) { });
</script>``` 
or 
```<script>
$.getJSON("https://155.84.104.53:9295/ingest?id=100&url='padpors103'", function (data) { });
</script>```
the script works but send it through https protocol and the target sever doesn't support https request.
what should I do to send it through http protocol?

That’s not possible – browsers will reject that, as you have seen. You must load the remote script via HTTPS, or serve your site via HTTP (which I absolutely do not recommend).

2 Likes

now what should I do. api we use just has HTTP and ignore the HTTPS request.I should send my request through HTTP .

Maybe ask the API provider to support HTTPS (which will require the use of a domain)?

1 Like

I have asked them but they say because of price we don’t support HTTPS request

Then you’re out of luck. Either move your site to HTTP (which basically destroys its security), find a different API provider if possible, or build a workaround – maybe you can proxy these requests via your server?

5 Likes

Tell them about https://letsencrypt.org/ which provides free SSL certificates :wink:

7 Likes

Though it’s only free as in money – it still costs time to set up and make sure it works correctly. (And time is often money as well, if the person doing this does it as part of their job.)

1 Like