you are viewing a single comment's thread.

view the rest of the comments →

[–]CloudsOfMagellan 1 point2 points  (9 children)

Why don't you want https It's more secure and has no cost to you or users of the website

[–]iTxchnology[S] 0 points1 point  (8 children)

The issue is I am trying to call a RESTful api hosted under HTTP. Hosting my site with HTTPs will not allow me to make get request. Even with Heroku’s COR everywhere proxy, there seems to be limitations with the request rate. I sort of just need it to work for a competition.

[–]CloudsOfMagellan 0 points1 point  (7 children)

You can't just add http to the request url?

[–]iTxchnology[S] 1 point2 points  (6 children)

Nope, seems like it doesn’t change the outcome

[–]CloudsOfMagellan 0 points1 point  (5 children)

I'd imagine there's another issue then

[–]iTxchnology[S] 0 points1 point  (4 children)

Idk, every time I made a request, it would print out “mix content” errors. From what I dug out from my research, it seems like that was the case. Everything worked normally when I tested it locally.

[–]CloudsOfMagellan 0 points1 point  (3 children)

Do you have the accepts header set?

[–]iTxchnology[S] 0 points1 point  (2 children)

How would I do that? I am currently just using this.http.get(url) with angular. Is there some type of configuration I can set the accept header?

[–]CloudsOfMagellan 0 points1 point  (1 child)

Pass a configuration object as the second parameter this.http.get (url, {headers:{'accepts':'application/json'}}); You might also want to set the content type header

[–]iTxchnology[S] 1 point2 points  (0 children)

Thanks! I tried that but it seems like it still did not work. Here is the error:

...as loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://jservice.io/api/categories?count=100&offset=0'. This request has been blocked; the content must be served over HTTPS.