0

URL の短縮に Google Nuget パッケージを使用したいと考えています。必要なファイルをすべて含めました

 public string shortenIt(string url)
    {       
        UrlshortenerService service = new UrlshortenerService(new BaseClientService.Initializer()
        {
            ApiKey = "*************************",
            ApplicationName = "***************",
        });
        Url response = service.Url.Insert(new Url { LongUrl = url }).Execute();
        return response.Id;
    }

次のエラーが表示されます

  Url response = service.Url.Insert(new Url { LongUrl = url }).Execute();

エラー:

  JsonReaderException: Error parsing NaN value. Path '', line 1, position 1 

解決策を教えてください..ありがとう

4

1 に答える 1

1

Google の URL 短縮サービスは利用できなくなりました。Google の Firebase Dynamic Links の使用に移行する必要があります。

ソース: https://developers.googleblog.com/2018/03/transitioning-google-url-shortener.html

于 2019-12-30T11:59:03.443 に答える