the server responded with a status of 429 (Too Many Requests) intlTelInput.js

廉价感情. 提交于 2021-01-27 04:16:11

问题


I am using intlTelInput.min.js for geo IP lookup with this code

jQuery("#teephnumber").intlTelInput({
        allowExtensions: true,
        defaultCountry: "auto",
        setNumber: "Telephone number",
        geoIpLookup: function(callback) {
            $.get('http://ipinfo.io', function() {}, "jsonp").always(function(resp) {
              var countryCode = (resp && resp.country) ? resp.country : "";
              callback(countryCode);
            });
          },
        nationalMode: false,
        utilsScript: "/wp-content/themes/imc/js/utils.js"
    });

it was working fine, but now not in console I see this error:

The server responded with a status of 429 (Too Many Requests), GET http://ipinfo.io/?callback=jQuery1112025137682701461017_1438183879450&_=1438183879451

And no javascript code because of this works.What can be the reason for this?


回答1:


See Rate limits here: https://ipinfo.io/developers

"You are limited to 1,000 API requests per day. If you need to make more requests, or need SSL support, see our paid plans."

I think you need to pay for more requests or find a way to reduce the requests you are making. You can probably cache the location so you only query once per user using localstorage.



来源:https://stackoverflow.com/questions/31704941/the-server-responded-with-a-status-of-429-too-many-requests-intltelinput-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!