How to Make an AJAX HTTPS GET Request Using jQuery

后端 未结 4 1114
有刺的猬
有刺的猬 2020-12-25 13:46

How can I explicitly make an AJAX HTTPS GET request using jQuery? I am trying to do the following. On an https page, I have a line with the code $.get(\"/resource\")

4条回答
  •  臣服心动
    2020-12-25 14:03

    I fixed the issue. It turned out that due to the way that our Django site was configured, I needed to add a trailing slash to resource in the AJAX request. Without the trailing the slash, Django would then redirect to the URL with the trailing slash using an HTTP request instead of an HTTPS request.

    In short, I replaced $.get("/resource") with $.get("/resource/").

    Thank you. I really appreciate all of your help.

提交回复
热议问题