JSONP request gives 404 in Angular app

前端 未结 2 827
我在风中等你
我在风中等你 2021-01-05 05:48

I\'m trying to get some data from an API with a JSONP request, but I get a 404 every time. I would assume my URL is wrong, but I can hit the URL manually in Chrome and get t

相关标签:
2条回答
  • 2021-01-05 06:31

    can you provide the exact content of window.console.log(siteNameUrl) just before your ajax request and provide the result ?
    Maybe try a siteNameUrl.toString() just in case it's a parsing problem
    it seems that you're not requesting the exact same url...
    Try even putting hard written the siteNameUrl you're using as siteNameUrl="www.someapi/api"

    0 讨论(0)
  • 2021-01-05 06:34

    After talking with some back-end developers, it appears the API I am using does not support JSONP. This is the reason I was getting a 404 on that request.

    0 讨论(0)
提交回复
热议问题