Ajax请求不触发成功,响应200
我试图通过ajax从ripe.net请求数据,但ajax请求从未触发成功函数,即使通过我得到一个http响应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)
目前我已经尝试了以下事情:
以上都不适合我。 你知道为什么没有调用成功函数,或者我做错了什么?
编辑:请求头是:
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
响应头是:
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
链接地址: http://www.djcxy.com/p/39199.html
上一篇: Ajax Request not triggering success, Response 200
下一篇: I keep getting "Uncaught SyntaxError: Unexpected token o"