我试图通过来自ripe.net的ajax请求数据,但是ajax请求永远不会触发成功函数,即使我得到一个http Response 200.我的当前代码如下所示:

$.ajax({
    headers: {
        Accept : "application/json; charset=utf-8",
    },
    type: 'GET',
    url: 'http://rest.db.ripe.net/search',
    data: {
        'source' : 'ripe',
        'query-string': '172.217.16.67',
        'type-filter': 'inetnum'
    },
    success: function(res) {
        console.log(res);
    }
});

(我将IP更改为google.com)

目前我已尝试过以下方面:

  • 设置无 Headers (我需要使用Accept:"application/json"设置 Headers ,因为我需要JSON格式

  • 在beforeSend中设置 Headers

  • 将dataType设置为json

  • 将dataType设置为jsonp(抛出错误)

  • 将dataType设置为文本

  • 将contentType设置为"application/json; charset=utf-8"

  • 添加crossDomain:true

  • add processData:false

以上都不适合我 . 你知道为什么没有调用成功函数,或者我做错了什么?

编辑:请求 Headers 是:

Host: rest.db.ripe.net
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Accept: application/json; charset=utf-8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: ...
Origin: ...
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

Responseheaders是:

Date: Thu, 21 Dec 2017 11:15:54 GMT
Server: Jetty(9.3.z-SNAPSHOT)
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Content-Encoding: gzip
Keep-Alive: timeout=15, max=100
Content-Length: 1148
Accept-Ranges: none
Connection: keep-alive