ipinfo / csharp

Official C# Library for IPinfo API (IP geolocation and other types of IP data)
http://ipinfo.io
Apache License 2.0
42 stars 9 forks source link

I get a server error #21

Closed vesnx closed 10 months ago

vesnx commented 1 year ago

here is the relevant code

            if (_client.DefaultRequestHeaders.Authorization is null || !_client.DefaultRequestHeaders.Authorization.ToString().Contains(apikey))
            {
                _client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", apikey);
                _client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
            }
            var result=new List<string>();  
            DomainRoot? answer=null;
            int page = 1;
            do
            {
                using var request = await _client.GetAsync($"https://ipinfo.io/domains/{address}?token={apikey}&page={page}").ConfigureAwait(false);
                if (!request.IsSuccessStatusCode)
                {
                    _logger?.LogWarning($"{request.StatusCode}:{request.ReasonPhrase}");
                    return Array.Empty<string>();
                }
             }while(...);

I keep getting an error code 500 image

UmanShahzad commented 1 year ago

Thanks a lot for the report. This seems to be an issue in the API itself and not the SDK. We'll inform you when that gets fixed.

Really appreciate you reporting it!

UmanShahzad commented 1 year ago

@vesnx did you see this error again? It should be fixed