Why do I get this 501 Not Implemented error?

前端 未结 3 1727
眼角桃花
眼角桃花 2020-12-07 02:44

I am performing the following AJAX call:

$(document).ready(function() {

  $.getJSON(\'https://sendgrid.com/api/user.stats.json\',
    {
      \'api_user\':          


        
3条回答
  •  粉色の甜心
    2020-12-07 03:24

    I don't know if this is related, but generally when requesting JSON on the client to a server in a different domain you'll need to use JSONP instead of JSON due to the Same Origin Policy. Unfortunately, it doesn't appear that their API supports using JSONP -- so they must expect you to interact with their site from your server. In that case you'll need proxy methods on your server to translate the calls to their API so that the client calls are made to a server in the same domain as the page.

提交回复
热议问题